Sha256: dc87ddc5e53d004d4c2f2333159a5c215d006dd169a4f307e900f9f18f854ef6

Contents?: true

Size: 553 Bytes

Versions: 1

Compression:

Stored size: 553 Bytes

Contents

require 'pathname'

APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
  executable_path = ENV["PATH"].split(File::PATH_SEPARATOR).find do |path|
    normalized_path = File.expand_path(path)

    normalized_path != __dir__ && File.executable?(Pathname.new(normalized_path).join('yarn'))
  end

  exec File.expand_path(Pathname.new(executable_path).join('yarn')), *ARGV
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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
railties-6.1.0.rc2 lib/rails/generators/rails/app/templates/bin/yarn.tt