Skip to content
Snippets Groups Projects
Commit ce092d90 authored by ilovezfs's avatar ilovezfs
Browse files

bump-formula-pr: set sha256 automatically when possible

parent b432f8e9
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,16 @@ module Homebrew
elsif !hash_type
odie "#{formula}: no tag/revision specified!"
else
odie "#{formula}: no url/#{hash_type} specified!"
rsrc = Resource.new { @url = new_url }
rsrc.download_strategy = CurlDownloadStrategy
rsrc.owner = Resource.new(formula.name)
rsrc_path = rsrc.fetch
if Utils.popen_read("/usr/bin/tar", "-tf", rsrc_path) =~ /\/.*\./
new_hash = rsrc_path.sha256
else
odie "#{formula}: no url/#{hash_type} specified!" if new_url.include?(".tar")
new_hash = rsrc_path.sha256
end
end
if ARGV.dry_run?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment