Sha256: 535498694364fcf2f5459dceadad883a1c9cd5a82899839378eb7ef5d98389fe

Contents?: true

Size: 616 Bytes

Versions: 3

Compression:

Stored size: 616 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
  yarn = ENV["PATH"].split(File::PATH_SEPARATOR)
                    .reject { |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
    warn("Yarn executable was not detected in the system.")
    warn("Download Yarn at https://yarnpkg.com/en/docs/install")
    exit(1)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
zapp-0.2.1 examples/rails-app/bin/yarn
zapp-0.1.1 examples/rails-app/bin/yarn
zapp-0.1.0 examples/rails-app/bin/yarn