| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5a49e31 commit bd62771
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,24 +2,27 @@ | |||
| 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 | - npx dmn@2.2.2 -f clean | ||
| 22 | + "$NODE" "$NPM" exec -- dmn@2.2.2 -f clean | ||
| 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 | - npx removeNPMAbsolutePaths@1.0.4 . | ||
| 25 | + "$NODE" "$NPM" exec -- removeNPMAbsolutePaths@1.0.4 . | ||
| 23 | 26 | ||
| 24 | 27 | cd .. | |
| 25 | 28 | mv babel-eslint-tmp/node_modules/@babel node_modules/@babel | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,8 +2,6 @@ | |||
| 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 | - npx dmn@2.2.2 -f clean | ||
| 25 | + "$NODE" "$NPM" exec -- dmn@2.2.2 -f clean | ||
| 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 | - npx removeNPMAbsolutePaths@1.0.4 . | ||
| 28 | + "$NODE" "$NPM" exec -- removeNPMAbsolutePaths@1.0.4 . | ||
| 25 | 29 | ) | |
| 26 | 30 | ||
| 27 | 31 | mv eslint-tmp/node_modules/eslint node_modules/eslint | |
| Back | FazBrowse Home | New Git URL |
0 commit comments