diff --git a/CHANGELOG.md b/CHANGELOG.md index fc4dc6ad..b9fc50a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * Make installs more robust against temporary network issues by retrying failed downloads in `LanguagePack::Fetcher#fetch_untar`, which installs Rubies (#585) +* Yarn version upgraded to v1.0.2 + ## v167 (07/25/2016) * Update Bundler to 1.15.2 (#602) diff --git a/lib/language_pack/helpers/nodebin.rb b/lib/language_pack/helpers/nodebin.rb index c20b725c..199f53a4 100644 --- a/lib/language_pack/helpers/nodebin.rb +++ b/lib/language_pack/helpers/nodebin.rb @@ -19,7 +19,7 @@ def self.hardcoded_node_lts end def self.hardcoded_yarn - version = "0.22.0" + version = "1.0.2" { "number" => version, "url" => "https://yarnpkg.com/downloads/#{version}/yarn-v#{version}.tar.gz" diff --git a/lib/language_pack/helpers/yarn_installer.rb b/lib/language_pack/helpers/yarn_installer.rb index 6514bffb..a57c0788 100644 --- a/lib/language_pack/helpers/yarn_installer.rb +++ b/lib/language_pack/helpers/yarn_installer.rb @@ -11,7 +11,7 @@ def initialize end def name - "yarn-#{@version}" + "yarn-v#{@version}" end def binary_path @@ -21,10 +21,10 @@ def binary_path def install Dir.mktmpdir do |dir| Dir.chdir(dir) do - @fetcher.fetch_untar(@url, "dist") + @fetcher.fetch_untar(@url) end - FileUtils.mv("#{dir}/dist", name) + FileUtils.mv(File.join(dir, name), name) end end end diff --git a/spec/helpers/yarn_installer_spec.rb b/spec/helpers/yarn_installer_spec.rb index 2957f814..86ada6bb 100644 --- a/spec/helpers/yarn_installer_spec.rb +++ b/spec/helpers/yarn_installer_spec.rb @@ -12,7 +12,7 @@ # webpacker gem checks for yarnpkg # https://github.com/rails/webpacker/blob/master/lib/install/bin/yarn.tt#L5 - expect(File.exist?("yarn-#{installer.version}/bin/yarnpkg")).to be(true) + expect(File.exist?("yarn-v#{installer.version}/bin/yarnpkg")).to be(true) end end end