comparison bin/yarn @ 481:88fd5722fcb3

Update defaults
author nanaya <me@nanaya.pro>
date Sun, 28 Nov 2021 19:45:05 +0900
parents 07d6c6639adf
children
comparison
equal deleted inserted replaced
480:2672acc670d2 481:88fd5722fcb3
1 #!/usr/bin/env ruby 1 #!/usr/bin/env ruby
2 APP_ROOT = File.expand_path('..', __dir__) 2 APP_ROOT = File.expand_path('..', __dir__)
3 Dir.chdir(APP_ROOT) do 3 Dir.chdir(APP_ROOT) do
4 begin 4 yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
5 exec "yarnpkg", *ARGV 5 select { |dir| File.expand_path(dir) != __dir__ }.
6 rescue Errno::ENOENT 6 product(["yarn", "yarn.exe"]).
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
7 $stderr.puts "Yarn executable was not detected in the system." 13 $stderr.puts "Yarn executable was not detected in the system."
8 $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 14 $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9 exit 1 15 exit 1
10 end 16 end
11 end 17 end