GeezerVison is showing github.com — tools: use bundled npm in update scripts · nodejs/node@bd62771
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: tools/update-babel-eslint.sh +9-6Lines changed: 9 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
2 | 2 |
|
3 | 3 | # Shell script to update babel-eslint in the source tree to the latest release. |
4 | 4 |
|
5 | | -# Depends on npm, npx, and node being in $PATH. |
6 | | - |
7 | 5 | # This script must be be in the tools directory when it runs because it uses |
8 | 6 | # $0 to determine directories to work in. |
9 | 7 |
|
10 | 8 | cd "$( dirname "${0}" )" || exit |
11 | 9 | rm -rf node_modules/@babel |
12 | 10 | mkdir babel-eslint-tmp |
13 | 11 | cd babel-eslint-tmp || exit |
14 | | -npm init --yes |
15 | 12 |
|
16 | | -npm install --global-style --no-bin-links --production --no-package-lock @babel/core @babel/eslint-parser@latest @babel/plugin-syntax-class-properties@latest @babel/plugin-syntax-top-level-await@latest |
| 13 | +ROOT="$PWD/../.." |
| 14 | +[ -z "$NODE" ] && NODE="$ROOT/out/Release/node" |
| 15 | +[ -x "$NODE" ] || NODE=`command -v node` |
| 16 | +NPM="$ROOT/deps/npm" |
| 17 | + |
| 18 | +"$NODE" "$NPM" init --yes |
| 19 | +"$NODE" "$NPM" install --global-style --no-bin-links --production --no-package-lock @babel/core @babel/eslint-parser@latest @babel/plugin-syntax-class-properties@latest @babel/plugin-syntax-top-level-await@latest |
17 | 20 |
|
18 | 21 | # Use dmn to remove some unneeded files. |
19 | | - |
| 22 | + |
20 | 23 | # Use removeNPMAbsolutePaths to remove unused data in package.json. |
21 | 24 | # This avoids churn as absolute paths can change from one dev to another. |
22 | | - |
| 25 | + |
23 | 26 |
|
24 | 27 | cd .. |
25 | 28 | mv babel-eslint-tmp/node_modules/@babel node_modules/@babel |
|
Collapse file
Copy file name to clipboardExpand all lines: tools/update-eslint.sh +11-7Lines changed: 11 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
2 | 2 |
|
3 | 3 | # Shell script to update ESLint in the source tree to the latest release. |
4 | 4 |
|
5 | | -# Depends on npm, npx, and node being in $PATH. |
6 | | - |
7 | 5 | # This script must be in the tools directory when it runs because it uses the |
8 | 6 | # script source file path to determine directories to work in. |
9 | 7 |
|
@@ -12,16 +10,22 @@ rm -rf node_modules/eslint node_modules/eslint-plugin-markdown |
12 | 10 | ( |
13 | 11 | mkdir eslint-tmp |
14 | 12 | cd eslint-tmp || exit |
15 | | - npm init --yes |
16 | 13 |
|
17 | | - npm install --global-style --no-bin-links --production --no-package-lock eslint@latest |
18 | | - npm install --global-style --no-bin-links --production --no-package-lock eslint-plugin-markdown@latest |
| 14 | + ROOT="$PWD/../.." |
| 15 | + [ -z "$NODE" ] && NODE="$ROOT/out/Release/node" |
| 16 | + [ -x "$NODE" ] || NODE=`command -v node` |
| 17 | + NPM="$ROOT/deps/npm" |
| 18 | + |
| 19 | + "$NODE" "$NPM" init --yes |
| 20 | + |
| 21 | + "$NODE" "$NPM" install --global-style --no-bin-links --production --no-package-lock eslint@latest |
| 22 | + "$NODE" "$NPM" install --global-style --no-bin-links --production --no-package-lock eslint-plugin-markdown@latest |
19 | 23 |
|
20 | 24 | # Use dmn to remove some unneeded files. |
21 | | - |
| 25 | + |
22 | 26 | # Use removeNPMAbsolutePaths to remove unused data in package.json. |
23 | 27 | # This avoids churn as absolute paths can change from one dev to another. |
24 | | - |
| 28 | + |
25 | 29 | ) |
26 | 30 |
|
27 | 31 | mv eslint-tmp/node_modules/eslint node_modules/eslint |
|