Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failure installing yarn 1.22.22 #1519

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- Default Node.js version now 22.11.0 (https://github.com/heroku/heroku-buildpack-ruby/pull/1503)
- Default Yarn version now 1.22.22 (https://github.com/heroku/heroku-buildpack-ruby/pull/1503)

## [v282] - 2024-11-08

Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions lib/language_pack/fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ def fetch(path)
run!(curl, error_class: FetchError)
end

def fetch_untar(path, files_to_extract = nil)
def fetch_untar(path, files_to_extract = nil, strip_components: 0)
curl = curl_command("#{@host_url.join(path)} -s -o")
run! "#{curl} - | tar zxf - #{files_to_extract}",
tar_cmd = ["tar zxf - #{files_to_extract}", "--strip #{strip_components}"]
run! "#{curl} - | #{tar_cmd.join(" ")}",
error_class: FetchError,
max_attempts: 3
end
Expand Down
4 changes: 2 additions & 2 deletions lib/language_pack/helpers/yarn_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def binary_path
def install
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
@fetcher.fetch_untar(@url)
@fetcher.fetch_untar(@url, strip_components: 1)
end

FileUtils.mv(File.join(dir, name), name)
FileUtils.cp_r(dir, name)
end
end
end