Skip to content

Commit

Permalink
Merge pull request #620 from heroku/schneems/upgrade-yarn
Browse files Browse the repository at this point in the history
[close rails/webpacker#739] Upgrade Yarn to 1.0.2
  • Loading branch information
schneems authored Sep 26, 2017
2 parents 10f2f86 + 18671ff commit 74a9069
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/language_pack/helpers/nodebin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions lib/language_pack/helpers/yarn_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize
end

def name
"yarn-#{@version}"
"yarn-v#{@version}"
end

def binary_path
Expand All @@ -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
2 changes: 1 addition & 1 deletion spec/helpers/yarn_installer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 74a9069

Please sign in to comment.