From 0e4c3d5072f4ac533ad1972ee012d31440713266 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 5 Mar 2026 12:18:51 -0800 Subject: [PATCH] tools: improve error handling in test426 update script If the current SHA is not found in the README for some reason, exit with an error. --- tools/dep_updaters/update-test426-fixtures.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/dep_updaters/update-test426-fixtures.sh b/tools/dep_updaters/update-test426-fixtures.sh index 730e7b67e35aa1..a1a97797c29357 100755 --- a/tools/dep_updaters/update-test426-fixtures.sh +++ b/tools/dep_updaters/update-test426-fixtures.sh @@ -6,11 +6,17 @@ BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd) TARGET_DIR="$BASE_DIR/test/fixtures/test426" README="$BASE_DIR/test/test426/README.md" -TARBALL_URL=$(curl -fsIo /dev/null -w '%header{Location}' https://github.com/tc39/source-map-tests/archive/HEAD.tar.gz) -SHA=$(basename "$TARBALL_URL") CURRENT_SHA=$(sed -n 's#^.*https://github.com/tc39/source-map-tests/commit/\([0-9a-f]*\).*$#\1#p' "$README") +if [ -z "$CURRENT_SHA" ]; then + echo "Could not find source-map-tests commit marker in $README" >&2 + exit 1 +fi + +TARBALL_URL=$(curl -fsIo /dev/null -w '%header{Location}' https://github.com/tc39/source-map-tests/archive/HEAD.tar.gz) +SHA=$(basename "$TARBALL_URL") + if [ "$CURRENT_SHA" = "$SHA" ]; then echo "Already up-to-date" exit 0