From 4f8355664a19369004e035f2b66c86e1688fb067 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 9 Jul 2020 10:45:04 +0200 Subject: [PATCH] bin: get closer from the default template of Rails 6 --- bin/setup | 7 ++++--- bin/update | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/setup b/bin/setup index a6ada35ea..371d1446b 100755 --- a/bin/setup +++ b/bin/setup @@ -1,6 +1,5 @@ #!/usr/bin/env ruby require 'fileutils' -include FileUtils # path to your application root. APP_ROOT = File.expand_path('..', __dir__) @@ -9,13 +8,15 @@ def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") end -chdir APP_ROOT do +FileUtils.chdir APP_ROOT do # This script is a starting point to setup your application. # Add necessary setup steps to this file. puts "\n== Installing dependencies ==" system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') + + # Install JavaScript dependencies system! 'bin/yarn install' puts "\n== Updating webdrivers ==" @@ -23,7 +24,7 @@ chdir APP_ROOT do puts "\n== Copying sample files ==" unless File.exist?('.env') - cp 'config/env.example', '.env' + FileUtils.cp 'config/env.example', '.env' end # Create the database, load the schema, and initialize it with the seed data diff --git a/bin/update b/bin/update index 3c8f58d28..1f9877a1a 100755 --- a/bin/update +++ b/bin/update @@ -1,6 +1,5 @@ #!/usr/bin/env ruby require 'fileutils' -include FileUtils # path to your application root. APP_ROOT = File.expand_path('..', __dir__) @@ -9,7 +8,7 @@ def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") end -chdir APP_ROOT do +FileUtils.chdir APP_ROOT do # This script is a way to update your development environment automatically. # Add necessary update steps to this file.