From f173ec77fc35ce57e94398310308e868689366bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Fri, 7 Dec 2018 07:01:32 +0100 Subject: Abort early if generator command fails (#34420) * No need to go through ruby * Abort early if a generator command fails * Reuse `rails_command` method * Bump thor minimum dependency to 0.20.3 * Add some minimal docs * Add a changelog entry * Restore original logging --- guides/source/rails_application_templates.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'guides/source') diff --git a/guides/source/rails_application_templates.md b/guides/source/rails_application_templates.md index bc68a555c5..982df26987 100644 --- a/guides/source/rails_application_templates.md +++ b/guides/source/rails_application_templates.md @@ -195,6 +195,12 @@ You can also run commands as a super-user: rails_command "log:clear", sudo: true ``` +You can also run commands that should abort application generation if they fail: + +```ruby +rails_command "db:migrate", abort_on_failure: true +``` + ### route(routing_code) Adds a routing entry to the `config/routes.rb` file. In the steps above, we generated a person scaffold and also removed `README.rdoc`. Now, to make `PeopleController#index` the default page for the application: -- cgit v1.2.3