lib/tasks/erb2haml.rake in haml-rails-1.0.0 vs lib/tasks/erb2haml.rake in haml-rails-2.0.0
- old
+ new
@@ -56,11 +56,15 @@
puts "\t#{file}"
end
puts '-'*80
begin
- puts 'Would you like to delete the original .erb files? (This is not recommended unless you are under version control.) (y/n)'
- should_delete = STDIN.gets.chomp.downcase[0]
+ if ENV.has_key?("HAML_RAILS_DELETE_ERB")
+ should_delete = ENV["HAML_RAILS_DELETE_ERB"] == "true" ? "y" : "n"
+ else
+ puts 'Would you like to delete the original .erb files? (This is not recommended unless you are under version control.) (y/n)'
+ should_delete = STDIN.gets.chomp.downcase[0]
+ end
end until ['y', 'n'].include?(should_delete)
if should_delete == 'y'
puts "Deleting original .erb files."
File.delete(*erb_files)