From cd83855a1563fcbea15aeece375a6f18805670ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harold=20Gim=C3=A9nez?= Date: Mon, 31 Oct 2011 09:23:02 -0400 Subject: [PATCH] Initialize a git repo, in preparation for --heroku flag --- lib/suspenders/app_builder.rb | 6 ++++++ lib/suspenders/generators/app_generator.rb | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/suspenders/app_builder.rb b/lib/suspenders/app_builder.rb index 8464dae32..9c6ea44a5 100644 --- a/lib/suspenders/app_builder.rb +++ b/lib/suspenders/app_builder.rb @@ -127,6 +127,12 @@ def gitignore_files end end + def init_git + run "git init" + run "git add -A ." + run "git commit -m 'Initial commit - suspended project'" + end + def copy_miscellaneous_files copy_file "errors.rb", "config/initializers/errors.rb" copy_file "time_formats.rb", "config/initializers/time_formats.rb" diff --git a/lib/suspenders/generators/app_generator.rb b/lib/suspenders/generators/app_generator.rb index 4c4e1a97f..71d398add 100644 --- a/lib/suspenders/generators/app_generator.rb +++ b/lib/suspenders/generators/app_generator.rb @@ -26,11 +26,11 @@ def suspenders_customization invoke :customize_gemfile invoke :configure_app invoke :setup_stylesheets - invoke :setup_gitignore invoke :copy_miscellaneous_files invoke :setup_root_route invoke :set_active_record_whitelist_attributes invoke :set_attr_accessibles_on_user + invoke :setup_git invoke :outro end @@ -97,11 +97,20 @@ def setup_stylesheets build(:setup_stylesheets) end + def setup_git + say "Initializing git and initial commit" + invoke :setup_gitignore + invoke :init_git + end + def setup_gitignore - say "Ignore the right files" build(:gitignore_files) end + def init_git + build(:init_git) + end + def copy_miscellaneous_files say "Copying miscellaneous support files" build(:copy_miscellaneous_files)