Use Thor's self.exit_on_failure? to exit whenever accessing the generators from the CLI and a Thor::Error is raised.

This commit is contained in:
Philip Arndt
2011-01-29 10:59:29 +08:00
committed by José Valim
parent 36f570dbd2
commit dcc72b2079

View File

@@ -15,4 +15,16 @@ require 'rubygems' if ARGV.include?("--dev")
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
module Rails
module Generators
class AppGenerator
# We want to exit on failure to be kind to other libraries
# This is only when accessing via CLI
def self.exit_on_failure?
true
end
end
end
end
Rails::Generators::AppGenerator.start