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

cask_loader: fix missing checksum in FromContentsLoader #14792

Merged
merged 1 commit into from Feb 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion Library/Homebrew/cask/cask_loader.rb
Expand Up @@ -45,7 +45,10 @@ def load(config:)
private

def cask(header_token, **options, &block)
Cask.new(header_token, source: content, **options, config: @config, &block)
checksum = {
"sha256" => Digest::SHA256.hexdigest(content),
}
Cask.new(header_token, source: content, source_checksum: checksum, **options, config: @config, &block)
Comment on lines +48 to +51
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this argument be made mandatory if things fail when it's not specified?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not mandatory if sourcefile_path is passed.

I don't really like the million parameters that Cask's constructor can take so will see if there's anything better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, gotcha, thanks.

end
end

Expand Down