2 # frozen_string_literal: true
4 APP_ROOT = File.expand_path("..", __dir__)
6 yarn = ENV["PATH"].split(File::PATH_SEPARATOR)
7 .reject { |dir| File.expand_path(dir) == __dir__ }
8 .product(["yarnpkg", "yarn", "yarn.cmd", "yarn.ps1"])
9 .map { |dir, file| File.expand_path(file, dir) }
10 .find { |file| File.executable?(file) }
13 exec yarn, "--ignore-engines", *ARGV
15 warn "Yarn executable was not detected in the system."
16 warn "Download Yarn at https://yarnpkg.com/en/docs/install"