Update Library/Homebrew/formula_creator.rb

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Anatoli Babenia 2025-03-28 06:59:02 +03:00
parent 62753a5ec6
commit 9f1093266d

View File

@ -83,7 +83,8 @@ module Homebrew
r.url(@url) r.url(@url)
r.owner = self r.owner = self
filepath = r.fetch filepath = r.fetch
raise "Downloaded URL is not archive" if File.read(filepath, 100).strip.start_with?("<!DOCTYPE html>") html_doctype_prefix = "<!doctype html"
raise "Downloaded URL is not archive" if File.read(filepath, html_doctype_prefix.length).downcase.start_with?(html_doctype_prefix)
@sha256 = filepath.sha256 @sha256 = filepath.sha256
end end