Update binstubs
This commit is contained in:
parent
d3ae4d86c7
commit
6136e3a3f8
4 changed files with 23 additions and 5 deletions
3
bin/rspec
Executable file
3
bin/rspec
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
||||||
|
load Gem.bin_path('rspec-core', 'rspec')
|
|
@ -1,10 +1,9 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require 'pathname'
|
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
include FileUtils
|
include FileUtils
|
||||||
|
|
||||||
# path to your application root.
|
# path to your application root.
|
||||||
APP_ROOT = Pathname.new File.expand_path('../', __dir__)
|
APP_ROOT = File.expand_path('..', __dir__)
|
||||||
|
|
||||||
def system!(*args)
|
def system!(*args)
|
||||||
system(*args) || abort("\n== Command #{args} failed ==")
|
system(*args) || abort("\n== Command #{args} failed ==")
|
||||||
|
@ -18,8 +17,11 @@ chdir APP_ROOT do
|
||||||
system! 'gem install bundler --conservative'
|
system! 'gem install bundler --conservative'
|
||||||
system('bundle check') || system!('bundle install')
|
system('bundle check') || system!('bundle install')
|
||||||
|
|
||||||
|
# Install JavaScript dependencies if using Yarn
|
||||||
|
# system('bin/yarn')
|
||||||
|
|
||||||
# puts "\n== Copying sample files =="
|
# puts "\n== Copying sample files =="
|
||||||
# if !File.exist?('config/database.yml')
|
# unless File.exist?('config/database.yml')
|
||||||
# cp 'config/database.yml.sample', 'config/database.yml'
|
# cp 'config/database.yml.sample', 'config/database.yml'
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require 'pathname'
|
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
include FileUtils
|
include FileUtils
|
||||||
|
|
||||||
# path to your application root.
|
# path to your application root.
|
||||||
APP_ROOT = Pathname.new File.expand_path('../', __dir__)
|
APP_ROOT = File.expand_path('..', __dir__)
|
||||||
|
|
||||||
def system!(*args)
|
def system!(*args)
|
||||||
system(*args) || abort("\n== Command #{args} failed ==")
|
system(*args) || abort("\n== Command #{args} failed ==")
|
||||||
|
@ -18,6 +17,9 @@ chdir APP_ROOT do
|
||||||
system! 'gem install bundler --conservative'
|
system! 'gem install bundler --conservative'
|
||||||
system('bundle check') || system!('bundle install')
|
system('bundle check') || system!('bundle install')
|
||||||
|
|
||||||
|
# Install JavaScript dependencies if using Yarn
|
||||||
|
# system('bin/yarn')
|
||||||
|
|
||||||
puts "\n== Updating database =="
|
puts "\n== Updating database =="
|
||||||
system! 'bin/rails db:migrate'
|
system! 'bin/rails db:migrate'
|
||||||
|
|
||||||
|
|
11
bin/yarn
Executable file
11
bin/yarn
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
APP_ROOT = File.expand_path('..', __dir__)
|
||||||
|
Dir.chdir(APP_ROOT) do
|
||||||
|
begin
|
||||||
|
exec "yarnpkg", *ARGV
|
||||||
|
rescue Errno::ENOENT
|
||||||
|
warn "Yarn executable was not detected in the system."
|
||||||
|
warn "Download Yarn at https://yarnpkg.com/en/docs/install"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue