comparison bin/update @ 459:07d6c6639adf

Upgrade to rails 5.2. RIP code style.
author nanaya <me@nanaya.pro>
date Sat, 14 Apr 2018 04:19:52 +0900
parents 68eb23b52864
children
comparison
equal deleted inserted replaced
458:1c6a056269e6 459:07d6c6639adf
1 #!/usr/bin/env ruby 1 #!/usr/bin/env ruby
2 require 'pathname'
3 require 'fileutils' 2 require 'fileutils'
4 include FileUtils 3 include FileUtils
5 4
6 # path to your application root. 5 # path to your application root.
7 APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 6 APP_ROOT = File.expand_path('..', __dir__)
8 7
9 def system!(*args) 8 def system!(*args)
10 system(*args) || abort("\n== Command #{args} failed ==") 9 system(*args) || abort("\n== Command #{args} failed ==")
11 end 10 end
12 11
16 15
17 puts '== Installing dependencies ==' 16 puts '== Installing dependencies =='
18 system! 'gem install bundler --conservative' 17 system! 'gem install bundler --conservative'
19 system('bundle check') || system!('bundle install') 18 system('bundle check') || system!('bundle install')
20 19
20 # Install JavaScript dependencies if using Yarn
21 # system('bin/yarn')
22
21 puts "\n== Updating database ==" 23 puts "\n== Updating database =="
22 system! 'bin/rails db:migrate' 24 system! 'bin/rails db:migrate'
23 25
24 puts "\n== Removing old logs and tempfiles ==" 26 puts "\n== Removing old logs and tempfiles =="
25 system! 'bin/rails log:clear tmp:clear' 27 system! 'bin/rails log:clear tmp:clear'