Merge pull request #419 from bhollis/gitignore

Generate a .gitgnore file by default
This commit is contained in:
Thomas Reynolds 2012-05-05 19:53:42 -07:00
commit c01a57db33
3 changed files with 25 additions and 0 deletions

View file

@ -6,6 +6,7 @@ Feature: Middleman CLI
When I cd to "MY_PROJECT"
Then the following files should exist:
| Gemfile |
| .gitignore |
| config.rb |
| source/index.html.erb |
| source/images/background.png |

View file

@ -63,6 +63,16 @@ module Middleman::Templates
run('bundle install', :capture => true)
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

View 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