| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | # This script must be in the tools directory when it runs because it uses the | |
| 6 | 6 | # script source file path to determine directories to work in. | |
| 7 | 7 | ||
| 8 | - set -e | ||
| 8 | + set -ex | ||
| 9 | 9 | ||
| 10 | 10 | ROOT=$(cd "$(dirname "$0")/../.." && pwd) | |
| 11 | 11 | DEPS_DIR="$ROOT/deps" | |
@@ -36,29 +36,24 @@ compare_dependency_version "undici" "$NEW_VERSION" "$CURRENT_VERSION" | |||
| 36 | 36 | rm -rf deps/undici/src | |
| 37 | 37 | rm -f deps/undici/undici.js | |
| 38 | 38 | ||
| 39 | - WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp') | ||
| 40 | - echo "$WORKSPACE" | ||
| 39 | + TARBALL=$(mktemp 2> /dev/null || mktemp -t 'tmp') | ||
| 40 | + | ||
| 41 | 41 | cleanup () { | |
| 42 | 42 | EXIT_CODE=$? | |
| 43 | - [ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE" | ||
| 43 | + [ -e "$TARBALL" ] && rm "$TARBALL" | ||
| 44 | 44 | exit $EXIT_CODE | |
| 45 | 45 | } | |
| 46 | 46 | ||
| 47 | 47 | trap cleanup INT TERM EXIT | |
| 48 | 48 | ||
| 49 | - UNDICI_ZIP="undici-$NEW_VERSION" | ||
| 50 | - cd "$WORKSPACE" | ||
| 51 | - | ||
| 52 | 49 | echo "Fetching UNDICI source archive..." | |
| 53 | - curl -sL -o "$UNDICI_ZIP.zip" "https://github.com/nodejs/undici/archive/refs/tags/v$NEW_VERSION.zip" | ||
| 50 | + curl -fsSLo "$TARBALL" "https://github.com/nodejs/undici/archive/refs/tags/v$NEW_VERSION.tar.gz" | ||
| 54 | 51 | ||
| 55 | - log_and_verify_sha256sum "undici" "$UNDICI_ZIP.zip" | ||
| 52 | + log_and_verify_sha256sum "undici" "$TARBALL" | ||
| 56 | 53 | ||
| 57 | 54 | echo "Unzipping..." | |
| 58 | - unzip "$UNDICI_ZIP.zip" -d "src" | ||
| 59 | - mv "src/$UNDICI_ZIP" "$DEPS_DIR/undici/src" | ||
| 60 | - rm "$UNDICI_ZIP.zip" | ||
| 61 | - cd "$ROOT" | ||
| 55 | + tar -xzf "$TARBALL" -C "$DEPS_DIR/undici" | ||
| 56 | + mv "$DEPS_DIR/undici"/undici-* "$DEPS_DIR/undici/src" | ||
| 62 | 57 | ||
| 63 | 58 | ( | |
| 64 | 59 | cd "$DEPS_DIR/undici/src" | |
@@ -92,8 +87,8 @@ cat > "$ROOT/src/undici_version.h" <<EOF | |||
| 92 | 87 | #endif // SRC_UNDICI_VERSION_H_ | |
| 93 | 88 | EOF | |
| 94 | 89 | ||
| 95 | - mv deps/undici/src/undici-fetch.js deps/undici/undici.js | ||
| 96 | - cp deps/undici/src/LICENSE deps/undici/LICENSE | ||
| 90 | + mv "$DEPS_DIR/undici/src/undici-fetch.js" "$DEPS_DIR/undici/undici.js" | ||
| 91 | + cp "$DEPS_DIR/undici/src/LICENSE" "$DEPS_DIR/undici/LICENSE" | ||
| 97 | 92 | ||
| 98 | 93 | # Update the version number on maintaining-dependencies.md | |
| 99 | 94 | # and print the new version as the last line of the script as we need | |
| Back | FazBrowse Home | New Git URL |
0 commit comments