Skip to content

Commit

Permalink
Use here-string for shasum
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Aug 11, 2024
1 parent f20af19 commit eb8b82e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ download_and_checksum() {
local checksum="${2:?}"
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 "${url}" -o tmp
if type -P sha256sum &>/dev/null; then
echo "${checksum} *tmp" | sha256sum -c - >/dev/null
sha256sum -c - >/dev/null <<<"${checksum} *tmp"
elif type -P shasum &>/dev/null; then
# GitHub-hosted macOS runner does not install GNU Coreutils by default.
# https://github.com/actions/runner-images/issues/90
echo "${checksum} *tmp" | shasum -a 256 -c - >/dev/null
shasum -a 256 -c - >/dev/null <<<"${checksum} *tmp"
else
warn "checksum requires 'sha256sum' or 'shasum' command; consider installing one of them; skipped checksum for $(basename "${url}")"
fi
Expand Down

0 comments on commit eb8b82e

Please sign in to comment.