diff options
author | dixpac <dino.onex@gmail.com> | 2017-01-10 14:58:28 +0100 |
---|---|---|
committer | dixpac <dino.onex@gmail.com> | 2017-01-12 17:21:56 +0100 |
commit | 8989a5057b6dc0e287a8b27ded31f08c5e56d0a7 (patch) | |
tree | e949aa43881afd227d97ba2e163d53bb16e65098 /railties/lib/rails | |
parent | 242d7e1e039dd36e9868f13824cb6770a9d01076 (diff) | |
download | rails-8989a5057b6dc0e287a8b27ded31f08c5e56d0a7.tar.gz rails-8989a5057b6dc0e287a8b27ded31f08c5e56d0a7.tar.bz2 rails-8989a5057b6dc0e287a8b27ded31f08c5e56d0a7.zip |
Initalize git repo when creatin new rails app
* If `--skip-git` is not specified initalize git repo
when creating new rails app
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 8efdfdcb44..bdeebbb8b5 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -53,6 +53,12 @@ module Rails template "gitignore", ".gitignore" end + def version_control + unless options[:skip_git] + run "git init" + end + end + def app directory "app" @@ -205,6 +211,7 @@ module Rails build(:configru) build(:gitignore) unless options[:skip_git] build(:gemfile) unless options[:skip_gemfile] + build(:version_control) end def create_app_files |