Skip to content
Snippets Groups Projects
Commit 120985e2 authored by Misty De Meo's avatar Misty De Meo Committed by GitHub
Browse files

Merge pull request #2684 from mistydemeo/add_vendored_sha256

Add vendored sha256
parents 90c97162 587f338d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -322,7 +322,7 @@ class Pathname
def sha256
require "digest/sha2"
incremental_hash(Digest::SHA2)
incremental_hash(Digest::SHA256)
end
def verify_checksum(expected)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment