From 975ab9e285baf4f1b22b60104db4f8f982c1db8b Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 21 Apr 2021 20:59:17 -0400 Subject: New Rails project with pgsql --- bin/yarn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/yarn (limited to 'bin/yarn') diff --git a/bin/yarn b/bin/yarn new file mode 100755 index 0000000..9fab2c3 --- /dev/null +++ b/bin/yarn @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +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"]). + map { |dir, file| File.expand_path(file, dir) }. + find { |file| File.executable?(file) } + + if yarn + exec 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 + end +end -- cgit v1.2.3