Look yarnpkg in $PATH other than yarn (#42253)

This is defined as an issue in #37558; however, we take advantage of
Debian `yarnpkg` package. With that, `yarnpkg` users from Debian can
use `bin/yarn` and `yarn` package provided from Yarn community will
not be affected because `yarn` is executed first.
This commit is contained in:
Berkhan Berkdemir 2021-08-24 17:02:39 +03:00 committed by GitHub
parent af87199a80
commit 790723b92f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@ APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
select { |dir| File.expand_path(dir) != __dir__ }.
product(["yarn", "yarn.cmd", "yarn.ps1"]).
product(["yarn", "yarnpkg", "yarn.cmd", "yarn.ps1"]).
map { |dir, file| File.expand_path(file, dir) }.
find { |file| File.executable?(file) }