GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: avoid npm install in deps installation · nodejs/node@685f936

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tools/dep_updaters
    • update-acorn-walk.sh
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tools/dep_updaters/update-acorn-walk.sh‎

Copy file name to clipboardExpand all lines: tools/dep_updaters/update-acorn-walk.sh
+31-14Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77

88
set -ex
99

10-
ROOT=$(cd "$(dirname "$0")/../.." && pwd)
11-
[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
10+
BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd)
11+
[ -z "$NODE" ] && NODE="$BASE_DIR/out/Release/node"
1212
[ -x "$NODE" ] || NODE=$(command -v node)
13-
NPM="$ROOT/deps/npm/bin/npm-cli.js"
13+
NPM="$BASE_DIR/deps/npm/bin/npm-cli.js"
14+
DEPS_DIR="$BASE_DIR/deps"
1415

1516
# shellcheck disable=SC1091
16-
. "$ROOT/tools/dep_updaters/utils.sh"
17+
. "$BASE_DIR/tools/dep_updaters/utils.sh"
1718

1819
NEW_VERSION=$("$NODE" "$NPM" view acorn-walk dist-tags.latest)
1920
CURRENT_VERSION=$("$NODE" -p "require('./deps/acorn/acorn-walk/package.json').version")
@@ -23,21 +24,37 @@ compare_dependency_version "acorn-walk" "$NEW_VERSION" "$CURRENT_VERSION"
2324

2425
cd "$( dirname "$0" )/../.." || exit
2526

26-
rm -rf deps/acorn/acorn-walk
27+
echo "Making temporary workspace..."
2728

28-
(
29-
rm -rf acorn-walk-tmp
30-
mkdir acorn-walk-tmp
31-
cd acorn-walk-tmp || exit
29+
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp')
3230

33-
"$NODE" "$NPM" init --yes
31+
cleanup () {
32+
EXIT_CODE=$?
33+
[ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE"
34+
exit $EXIT_CODE
35+
}
3436

35-
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts "acorn-walk@$NEW_VERSION"
36-
)
37+
trap cleanup INT TERM EXIT
3738

38-
mv acorn-walk-tmp/node_modules/acorn-walk deps/acorn
39+
cd "$WORKSPACE"
3940

40-
rm -rf acorn-walk-tmp/
41+
echo "Fetching acorn-walk source archive..."
42+
43+
DIST_URL=$(curl -sL "https://registry.npmjs.org/acorn-walk/$NEW_VERSION" | perl -n -e '/"dist".*?"tarball":"(.*?)"/ && print $1')
44+
45+
ACORN_WALK_TGZ="acorn-walk.tgz"
46+
47+
curl -sL -o "$ACORN_WALK_TGZ" "$DIST_URL"
48+
49+
log_and_verify_sha256sum "acorn-walk" "$ACORN_WALK_TGZ"
50+
51+
rm -r "$DEPS_DIR/acorn/acorn-walk"/*
52+
53+
tar -xf "$ACORN_WALK_TGZ"
54+
55+
mv "$WORKSPACE/package"/* "$DEPS_DIR/acorn/acorn-walk"
56+
57+
rm "$ACORN_WALK_TGZ"
4158

4259
echo "All done!"
4360
echo ""

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.