Skip to content

Commit bc4fbf4

Browse files
committed
Update binstubs
1 parent 21d6b94 commit bc4fbf4

File tree

5 files changed

+17
-38
lines changed

5 files changed

+17
-38
lines changed

bin/rails

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#!/usr/bin/env ruby
2-
begin
3-
load File.expand_path('../spring', __FILE__)
4-
rescue LoadError => e
5-
raise unless e.message.include?('spring')
6-
end
72
APP_PATH = File.expand_path('../config/application', __dir__)
8-
require_relative '../config/boot'
9-
require 'rails/commands'
3+
require_relative "../config/boot"
4+
require "rails/commands"

bin/rake

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#!/usr/bin/env ruby
2-
begin
3-
load File.expand_path('../spring', __FILE__)
4-
rescue LoadError => e
5-
raise unless e.message.include?('spring')
6-
end
7-
require_relative '../config/boot'
8-
require 'rake'
2+
require_relative "../config/boot"
3+
require "rake"
94
Rake.application.run

bin/setup

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env ruby
2-
require 'fileutils'
2+
require "fileutils"
33

44
# path to your application root.
55
APP_ROOT = File.expand_path('..', __dir__)
@@ -9,16 +9,16 @@ def system!(*args)
99
end
1010

1111
FileUtils.chdir APP_ROOT do
12-
# This script is a way to setup or update your development environment automatically.
13-
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
12+
# This script is a way to set up or update your development environment automatically.
13+
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
1414
# Add necessary setup steps to this file.
1515

1616
puts '== Installing dependencies =='
1717
system! 'gem install bundler --conservative'
1818
system('bundle check') || system!('bundle install')
1919

2020
# Install JavaScript dependencies
21-
# system('bin/yarn')
21+
system! 'bin/yarn'
2222

2323
# puts "\n== Copying sample files =="
2424
# unless File.exist?('config/database.yml')

bin/spring

Lines changed: 0 additions & 17 deletions
This file was deleted.

bin/yarn

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
#!/usr/bin/env ruby
22
APP_ROOT = File.expand_path('..', __dir__)
33
Dir.chdir(APP_ROOT) do
4-
begin
5-
exec "yarnpkg", *ARGV
6-
rescue Errno::ENOENT
4+
yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
5+
select { |dir| File.expand_path(dir) != __dir__ }.
6+
product(["yarn", "yarn.cmd", "yarn.ps1"]).
7+
map { |dir, file| File.expand_path(file, dir) }.
8+
find { |file| File.executable?(file) }
9+
10+
if yarn
11+
exec yarn, *ARGV
12+
else
713
$stderr.puts "Yarn executable was not detected in the system."
814
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
915
exit 1

0 commit comments

Comments
 (0)