about summary refs log tree commit diff
path: root/bin/yarn
blob: 8c1535a78f8f5efecbe8343ec5ea524b3b3ed35a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env ruby
APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
  begin
    exec "yarnpkg #{ARGV.join(' ')}" unless Dir.exist?('node_modules')
  rescue Errno::ENOENT
    $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