1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #20926 from rsanheim/fail-fast-bin-setup

add system! to fail fast in bin/setup
This commit is contained in:
Rafael Mendonça França 2015-07-21 11:03:00 -03:00
commit b260a2735e

View file

@ -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