diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-07-21 11:03:00 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-07-21 11:03:00 -0300 |
commit | b260a2735ecf2b01e57cea2dd61fb0c8bbbaafe8 (patch) | |
tree | c11af40c5dd20820b57e5b0db3f957697093156b /railties/lib/rails | |
parent | 9582b3f509c67171b4668b37cf7f2f0736539429 (diff) | |
parent | d54d4356e3c458952d784c15ccd79e4e8ae39c9c (diff) | |
download | rails-b260a2735ecf2b01e57cea2dd61fb0c8bbbaafe8.tar.gz rails-b260a2735ecf2b01e57cea2dd61fb0c8bbbaafe8.tar.bz2 rails-b260a2735ecf2b01e57cea2dd61fb0c8bbbaafe8.zip |
Merge pull request #20926 from rsanheim/fail-fast-bin-setup
add system! to fail fast in bin/setup
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/bin/setup | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/bin/setup b/railties/lib/rails/generators/rails/app/templates/bin/setup index 0d41f2fe4c..a57b16444c 100644 --- a/railties/lib/rails/generators/rails/app/templates/bin/setup +++ b/railties/lib/rails/generators/rails/app/templates/bin/setup @@ -5,13 +5,17 @@ include FileUtils # path to your application root. APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + chdir APP_ROOT do # This script is a starting point to setup your application. # Add necessary setup steps to this file. puts '== Installing dependencies ==' - system 'gem install bundler --conservative' - system('bundle check') or system('bundle install') + system! 'gem install bundler --conservative' + system!('bundle check') or system!('bundle install') # puts "\n== Copying sample files ==" # unless File.exist?('config/database.yml') @@ -19,11 +23,11 @@ chdir APP_ROOT do # end puts "\n== Preparing database ==" - system 'ruby bin/rake db:setup' + system! 'ruby bin/rake db:setup' puts "\n== Removing old logs and tempfiles ==" - system 'ruby bin/rake log:clear tmp:clear' + system! 'ruby bin/rake log:clear tmp:clear' puts "\n== Restarting application server ==" - system 'ruby bin/rake restart' + system! 'ruby bin/rake restart' end |