From 282b6eb4b0f93daf711bb37c5179ff4797f1d58d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 9 Oct 2021 18:11:09 -0700 Subject: [PATCH] tools: fix ESLint update scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes to the npm dependency in the core repo require changes to update-eslint.sh and update-bable-eslint.sh. PR-URL: https://github.com/nodejs/node/pull/40394 Reviewed-By: Michaƫl Zasso Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca --- tools/update-babel-eslint.sh | 4 +++- tools/update-eslint.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/update-babel-eslint.sh b/tools/update-babel-eslint.sh index d9c8a47b2b9739..4afec8cf4ed923 100755 --- a/tools/update-babel-eslint.sh +++ b/tools/update-babel-eslint.sh @@ -5,6 +5,8 @@ # This script must be be in the tools directory when it runs because it uses # $0 to determine directories to work in. +set -e + cd "$( dirname "${0}" )" || exit rm -rf node_modules/@babel mkdir babel-eslint-tmp @@ -13,7 +15,7 @@ cd babel-eslint-tmp || exit ROOT="$PWD/../.." [ -z "$NODE" ] && NODE="$ROOT/out/Release/node" [ -x "$NODE" ] || NODE=`command -v node` -NPM="$ROOT/deps/npm" +NPM="$ROOT/deps/npm/bin/npm-cli.js" "$NODE" "$NPM" init --yes "$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-import-assertions@latest @babel/plugin-syntax-top-level-await@latest diff --git a/tools/update-eslint.sh b/tools/update-eslint.sh index eb1045267f70fc..8c9e5257edd3a8 100755 --- a/tools/update-eslint.sh +++ b/tools/update-eslint.sh @@ -5,6 +5,8 @@ # This script must be in the tools directory when it runs because it uses the # script source file path to determine directories to work in. +set -e + cd "$( dirname "$0" )" || exit rm -rf node_modules/eslint node_modules/eslint-plugin-markdown ( @@ -14,7 +16,7 @@ rm -rf node_modules/eslint node_modules/eslint-plugin-markdown ROOT="$PWD/../.." [ -z "$NODE" ] && NODE="$ROOT/out/Release/node" [ -x "$NODE" ] || NODE=`command -v node` - NPM="$ROOT/deps/npm" + NPM="$ROOT/deps/npm/bin/npm-cli.js" "$NODE" "$NPM" init --yes