Merge pull request #419 from bhollis/gitignore
Generate a .gitgnore file by default
This commit is contained in:
commit
c01a57db33
|
@ -6,6 +6,7 @@ Feature: Middleman CLI
|
||||||
When I cd to "MY_PROJECT"
|
When I cd to "MY_PROJECT"
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
| Gemfile |
|
| Gemfile |
|
||||||
|
| .gitignore |
|
||||||
| config.rb |
|
| config.rb |
|
||||||
| source/index.html.erb |
|
| source/index.html.erb |
|
||||||
| source/images/background.png |
|
| source/images/background.png |
|
||||||
|
|
|
@ -63,6 +63,16 @@ module Middleman::Templates
|
||||||
run('bundle install', :capture => true)
|
run('bundle install', :capture => true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Output a .gitignore file
|
||||||
|
class_option :git, :type => :boolean, :default => true
|
||||||
|
|
||||||
|
# Write a .gitignore file for project
|
||||||
|
# @return [void]
|
||||||
|
def generate_gitignore!
|
||||||
|
return unless options[:git]
|
||||||
|
copy_file "shared/gitignore", File.join(location, ".gitignore")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
14
middleman-core/lib/middleman-core/templates/shared/gitignore
Normal file
14
middleman-core/lib/middleman-core/templates/shared/gitignore
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||||
|
#
|
||||||
|
# If you find yourself ignoring temporary files generated by your text editor
|
||||||
|
# or operating system, you probably want to add a global ignore instead:
|
||||||
|
# git config --global core.excludesfile ~/.gitignore_global
|
||||||
|
|
||||||
|
# Ignore bundler config
|
||||||
|
/.bundle
|
||||||
|
|
||||||
|
# Ignore the build directory
|
||||||
|
/build
|
||||||
|
|
||||||
|
# Ignore Sass' cache
|
||||||
|
/.sass-cache
|
Loading…
Reference in a new issue