Update app files to Rails 6.1 defaults.
This commit is contained in:
14
bin/yarn
14
bin/yarn
@@ -1,9 +1,17 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'pathname'
|
||||
|
||||
APP_ROOT = File.expand_path('..', __dir__)
|
||||
Dir.chdir(APP_ROOT) do
|
||||
begin
|
||||
exec "yarnpkg", *ARGV
|
||||
rescue Errno::ENOENT
|
||||
executable_path = ENV["PATH"].split(File::PATH_SEPARATOR).find do |path|
|
||||
normalized_path = File.expand_path(path)
|
||||
|
||||
normalized_path != __dir__ && File.executable?(Pathname.new(normalized_path).join('yarn'))
|
||||
end
|
||||
|
||||
if executable_path
|
||||
exec File.expand_path(Pathname.new(executable_path).join('yarn')), *ARGV
|
||||
else
|
||||
$stderr.puts "Yarn executable was not detected in the system."
|
||||
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user