aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator/options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails_generator/options.rb')
-rw-r--r--railties/lib/rails_generator/options.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/options.rb b/railties/lib/rails_generator/options.rb
index 042e05107d..5f6aefa921 100644
--- a/railties/lib/rails_generator/options.rb
+++ b/railties/lib/rails_generator/options.rb
@@ -136,6 +136,13 @@ module Rails
opt
end
end
+ opt.on('-g', '--git', 'Modify files with git. (Note: git must be in path)') do
+ options[:git] = `git status`.inject({:new => {}, :modified => {}}) do |opt, e|
+ opt[:new][e.chomp[14..-1]] = true if e =~ /new file:/
+ opt[:modified][e.chomp[14..-1]] = true if e =~ /modified:/
+ opt
+ end
+ end
end
end