Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 840e098

Browse filesBrowse files
Trottaduh95
authored andcommitted
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. PR-URL: #62121 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent fcf2a9f commit 840e098
Copy full SHA for 840e098

1 file changed

+8-2Lines changed: 8 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tools/dep_updaters/update-test426-fixtures.sh‎

Copy file name to clipboardExpand all lines: tools/dep_updaters/update-test426-fixtures.sh
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd)
66

77
TARGET_DIR="$BASE_DIR/test/fixtures/test426"
88
README="$BASE_DIR/test/test426/README.md"
9-
TARBALL_URL=$(curl -fsIo /dev/null -w '%header{Location}' https://github.com/tc39/source-map-tests/archive/HEAD.tar.gz)
10-
SHA=$(basename "$TARBALL_URL")
119

1210
CURRENT_SHA=$(sed -n 's#^.*https://github.com/tc39/source-map-tests/commit/\([0-9a-f]*\).*$#\1#p' "$README")
1311

12+
if [ -z "$CURRENT_SHA" ]; then
13+
echo "Could not find source-map-tests commit marker in $README" >&2
14+
exit 1
15+
fi
16+
17+
TARBALL_URL=$(curl -fsIo /dev/null -w '%header{Location}' https://github.com/tc39/source-map-tests/archive/HEAD.tar.gz)
18+
SHA=$(basename "$TARBALL_URL")
19+
1420
if [ "$CURRENT_SHA" = "$SHA" ]; then
1521
echo "Already up-to-date"
1622
exit 0

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.