diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 609d23e8d7..74f1b55176 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -82,7 +82,10 @@ module Homebrew r = Resource.new r.url(@url) r.owner = self - @sha256 = r.fetch.sha256 if r.download_strategy == CurlDownloadStrategy + filepath = r.fetch + raise "Downloaded URL is not archive" if File.read(filepath, 100).strip.start_with?("") + + @sha256 = filepath.sha256 end if @github