formula: consider arbitrary formula source paths

This commit is contained in:
EricFromCanada 2023-04-22 15:17:20 -04:00
parent 935649abaf
commit e67abce950
No known key found for this signature in database
GPG Key ID: 179D9CDDDB814168

View File

@ -2199,7 +2199,7 @@ class Formula
"sha256" => resource("ruby-source").checksum.hexdigest, "sha256" => resource("ruby-source").checksum.hexdigest,
} }
elsif !self.class.loaded_from_api && path.exist? elsif !self.class.loaded_from_api && path.exist?
hsh["ruby_source_path"] = path.relative_path_from(tap.path).to_s hsh["ruby_source_path"] = (path.relative_path_from(tap.path).to_s if tap)
hsh["ruby_source_checksum"] = { hsh["ruby_source_checksum"] = {
"sha256" => Digest::SHA256.file(path).hexdigest, "sha256" => Digest::SHA256.file(path).hexdigest,
} }