Skip to content

Commit

Permalink
refactor(scripts): Replace the gen-upgrade-proposal.sh temp file with…
Browse files Browse the repository at this point in the history
… an HTTP HEAD request

This makes its contents copyable for forum posts, which don't presume to
be running inside a script and don't require bash pipefail.
  • Loading branch information
gibson042 committed Apr 26, 2024
1 parent 0117a3d commit cea17a2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scripts/gen-upgrade-proposal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ COMMIT_ID=$(git rev-parse HEAD)
ZIP_URL="https://github.com/Agoric/agoric-sdk/archive/${COMMIT_ID}.zip"

echo "Verifying archive is at $ZIP_URL..." 1>&2
zipfile=$(mktemp)
trap 'rm -f "$zipfile"' EXIT
curl -L "$ZIP_URL" -o "$zipfile"
curl -fLI --no-progress-meter "$ZIP_URL" -o- > /dev/null

echo "Generating SHA-256 checksum..." 1>&2
CHECKSUM=sha256:$(shasum -a 256 "$zipfile" | cut -d' ' -f1)
CHECKSUM=sha256:$(curl -fL "$ZIP_URL" -o- | shasum -a 256 | cut -d' ' -f1)

BINARY_URL="$ZIP_URL//agoric-sdk-${COMMIT_ID}?checksum=$CHECKSUM"
SOURCE_URL="$ZIP_URL?checksum=$CHECKSUM"
Expand Down

0 comments on commit cea17a2

Please sign in to comment.