diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/vendor-install.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index 46f0c72f9..fe7e26dd4 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -82,6 +82,15 @@ fetch() { elif [[ -x "$(which sha256sum)" ]] then sha="$(sha256sum "$CACHED_LOCATION" | cut -d' ' -f1)" + elif [[ -x "$(which ruby)" ]] + then + sha="$(ruby <<EOSCRIPT + require 'digest/sha2' + digest = Digest::SHA256.new + File.open('$CACHED_LOCATION', 'rb') { |f| digest.update(f.read) } + puts digest.hexdigest +EOSCRIPT +)" else odie "Cannot verify the checksum ('shasum' or 'sha256sum' not found)!" fi |
