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: add automation for updating acorn dependency · nodejs/node@2ca30ca

File tree

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

‎.github/workflows/tools.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/tools.yml
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,26 @@ jobs:
8989
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
9090
./tools/update-base64.sh "$NEW_VERSION"
9191
fi
92+
- id: acorn
93+
subsystem: deps
94+
label: dependencies
95+
run: |
96+
NEW_VERSION=$(npm view acorn dist-tags.latest)
97+
CURRENT_VERSION=$(node -p "require('./deps/acorn/acorn/package.json').version")
98+
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
99+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
100+
./tools/update-acorn.sh
101+
fi
102+
- id: acorn-walk
103+
subsystem: deps
104+
label: dependencies
105+
run: |
106+
NEW_VERSION=$(npm view acorn-walk dist-tags.latest)
107+
CURRENT_VERSION=$(node -p "require('./deps/acorn/acorn-walk/package.json').version")
108+
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
109+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
110+
./tools/update-acorn-walk.sh
111+
fi
92112
steps:
93113
- uses: actions/checkout@v3
94114
with:
Collapse file

‎tools/update-acorn-walk.sh‎

Copy file name to clipboard
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
# Shell script to update acorn-walk in the source tree to the latest release.
4+
5+
# This script must be in the tools directory when it runs because it uses the
6+
# script source file path to determine directories to work in.
7+
8+
set -ex
9+
10+
cd "$( dirname "$0" )/.." || exit
11+
rm -rf deps/acorn/acorn-walk
12+
13+
(
14+
rm -rf acorn-walk-tmp
15+
mkdir acorn-walk-tmp
16+
cd acorn-walk-tmp || exit
17+
18+
ROOT="$PWD/.."
19+
[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
20+
[ -x "$NODE" ] || NODE=$(command -v node)
21+
NPM="$ROOT/deps/npm/bin/npm-cli.js"
22+
23+
"$NODE" "$NPM" init --yes
24+
25+
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts acorn-walk
26+
)
27+
28+
mv acorn-walk-tmp/node_modules/acorn-walk deps/acorn
29+
30+
rm -rf acorn-walk-tmp/
Collapse file

‎tools/update-acorn.sh‎

Copy file name to clipboard
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
# Shell script to update acorn in the source tree to the latest release.
4+
5+
# This script must be in the tools directory when it runs because it uses the
6+
# script source file path to determine directories to work in.
7+
8+
set -ex
9+
10+
cd "$( dirname "$0" )/.." || exit
11+
rm -rf deps/acorn/acorn
12+
13+
(
14+
rm -rf acorn-tmp
15+
mkdir acorn-tmp
16+
cd acorn-tmp || exit
17+
18+
ROOT="$PWD/.."
19+
[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
20+
[ -x "$NODE" ] || NODE=$(command -v node)
21+
NPM="$ROOT/deps/npm/bin/npm-cli.js"
22+
23+
"$NODE" "$NPM" init --yes
24+
25+
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts acorn
26+
)
27+
28+
mv acorn-tmp/node_modules/acorn deps/acorn
29+
30+
rm -rf acorn-tmp/

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.