Sha256: 8dec22bd9d443dcf9c1772179da3fd9c1a3cea4444be8080b6b789a0c5f33fde

Contents?: true

Size: 513 Bytes

Versions: 33

Compression:

Stored size: 513 Bytes

Contents

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

Version data entries

33 entries across 33 versions & 4 rubygems

Version Path
railties-6.1.7.10 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.7.9 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.7.8 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.7.7 lib/rails/generators/rails/app/templates/bin/yarn.tt
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.7.6 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.7.5 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.7.4 lib/rails/generators/rails/app/templates/bin/yarn.tt
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.7.3 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.7.2 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.7.1 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.7 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.6.1 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.6 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.5.1 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.5 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.4.7 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.4.6 lib/rails/generators/rails/app/templates/bin/yarn.tt
railties-6.1.4.5 lib/rails/generators/rails/app/templates/bin/yarn.tt