Skip to content

Commit

Permalink
Merge pull request #898 from Homebrew/stub-filename
Browse files Browse the repository at this point in the history
Properly stub resolved bottle filename.
  • Loading branch information
MikeMcQuaid committed Apr 4, 2023
2 parents 09eca62 + f523a8e commit 7dff71c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/tests/formulae.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,13 @@ def bottle_reinstall_formula(formula, new_formula, args:)
root_url = bottle_json.dig(formula.full_name, "bottle", "root_url")
filename = bottle_json.dig(formula.full_name, "bottle", "tags").values.first["filename"]

download_strategy = CurlDownloadStrategy.new("#{root_url}/#{filename}", formula.name, formula.version)
# Test bottle is never uploaded, so we need to stub a cached download.
download_strategy = CurlGitHubPackagesDownloadStrategy.new(
"#{root_url}/#{filename}",
formula.name,
formula.version,
)
download_strategy.resolved_basename = File.basename(@bottle_filename)
download_strategy.cached_location.parent.mkpath
FileUtils.ln @bottle_filename, download_strategy.cached_location, force: true
FileUtils.ln_s download_strategy.cached_location.relative_path_from(download_strategy.symlink_location),
Expand Down

0 comments on commit 7dff71c

Please sign in to comment.