Sha256: 397c287334275dbc8b032de5a87036c23b30a156235b2c8550e18ff685f2f00b

Contents?: true

Size: 555 Bytes

Versions: 3

Compression:

Stored size: 555 Bytes

Contents

namespace :webpacker do
  desc "Verifies if yarn is installed"
  task :check_yarn do
    required_yarn_version = "0.20.1"

    begin
      yarn_version = `yarn --version`

      raise Errno::ENOENT if yarn_version.blank? || Gem::Version.new(yarn_version) < Gem::Version.new(required_yarn_version)
    rescue Errno::ENOENT
      $stderr.puts "Webpacker requires Yarn version >= #{required_yarn_version}. Please download and install the latest version from https://yarnpkg.com/lang/en/docs/install/"
      $stderr.puts "Exiting!" && exit!
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
webpacker-3.0.0 lib/tasks/webpacker/check_yarn.rake
webpacker-react-on-rails-3.0.0.rc.1 lib/tasks/webpacker/check_yarn.rake
webpacker-react-on-rails-2.0 lib/tasks/webpacker/check_yarn.rake