File tree Expand file tree Collapse file tree
packages/pdf-runtime/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,17 @@ if [[ -z "$TARGET" ]]; then
1111 exit 1
1212fi
1313
14+ sha256_file () {
15+ if command -v shasum > /dev/null 2>&1 ; then
16+ shasum -a 256 " $1 " | awk ' {print $1}'
17+ elif command -v sha256sum > /dev/null 2>&1 ; then
18+ sha256sum " $1 " | awk ' {print $1}'
19+ else
20+ echo " missing sha256 checksum tool: install shasum or sha256sum" >&2
21+ exit 1
22+ fi
23+ }
24+
1425ARTIFACT_JSON=" $( node -e "
1526const fs = require('node:fs');
1627const file = process.argv[1];
@@ -47,7 +58,7 @@ if [[ ! -f "$ARCHIVE" ]]; then
4758 fi
4859fi
4960
50- ACTUAL_SHA=" $( shasum -a 256 " $ARCHIVE " | awk ' {print $1} ' ) "
61+ ACTUAL_SHA=" $( sha256_file " $ARCHIVE " ) "
5162if [[ " $ACTUAL_SHA " != " $SHA256 " ]]; then
5263 echo " sha256 mismatch for $ARCHIVE " >&2
5364 echo " expected: $SHA256 " >&2
Original file line number Diff line number Diff line change @@ -11,7 +11,18 @@ if [[ ! -f "$ARCHIVE" ]]; then
1111 exit 1
1212fi
1313
14- SHA256=" $( shasum -a 256 " $ARCHIVE " | awk ' {print $1}' ) "
14+ sha256_file () {
15+ if command -v shasum > /dev/null 2>&1 ; then
16+ shasum -a 256 " $1 " | awk ' {print $1}'
17+ elif command -v sha256sum > /dev/null 2>&1 ; then
18+ sha256sum " $1 " | awk ' {print $1}'
19+ else
20+ echo " missing sha256 checksum tool: install shasum or sha256sum" >&2
21+ exit 1
22+ fi
23+ }
24+
25+ SHA256=" $( sha256_file " $ARCHIVE " ) "
1526URL=" file://$ARCHIVE "
1627
1728node - << 'NODE ' "$MANIFEST" "$TARGET" "$URL" "$SHA256"
You can’t perform that action at this time.
0 commit comments