From f6fb18d4435043eec0fbc9ce70882b85ecd54e43 Mon Sep 17 00:00:00 2001 From: John Gorman Date: Mon, 27 Aug 2018 11:34:08 -0300 Subject: [PATCH] Fix .gitignore master.key bug. --- recipes/git.rb | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/recipes/git.rb b/recipes/git.rb index ae25b901..ff42367e 100644 --- a/recipes/git.rb +++ b/recipes/git.rb @@ -2,20 +2,17 @@ # https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/git.rb ## Git -say_wizard "initialize git" prefs[:git] = true unless prefs.has_key? :git if prefer :git, true - copy_from 'https://raw.github.com/RailsApps/rails-composer/master/files/gitignore.txt', '.gitignore' - git :init + if !File.directory?('.git') + say_wizard "initialize git" + git :init + end + if !File.file?('.gitignore') + copy_from 'https://raw.github.com/RailsApps/rails-composer/master/files/gitignore.txt', '.gitignore' + end git :add => '-A' git :commit => '-qm "rails_apps_composer: initial commit"' -else - stage_three do - say_wizard "recipe stage three" - say_wizard "removing .gitignore and .gitkeep files" - git_files = Dir[File.join('**','.gitkeep')] + Dir[File.join('**','.gitignore')] - File.unlink git_files - end end __END__