-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I've had to update this one too many times, and much of it can be automated, so let's do that! The maintenance instructions have also been updated. PR-URL: #35822 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
- Loading branch information
1 parent
6db44b4
commit b93e5e4
Showing
2 changed files
with
64 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
# Shell script to update npm in the source tree to a specific version | ||
|
||
BASE_DIR="$( pwd )"/ | ||
DEPS_DIR="$BASE_DIR"deps/ | ||
NPM_VERSION=$1 | ||
|
||
if [ "$#" -le 0 ]; then | ||
echo "Error: please provide an npm version to update to" | ||
exit 1 | ||
fi | ||
|
||
WORKSPACE="$TMPDIR"update-npm-$NPM_VERSION/ | ||
|
||
if [ -d "$WORKSPACE" ]; then | ||
echo "Cleaning up old workspace" | ||
rm -rf "$WORKSPACE" | ||
fi | ||
|
||
echo "Making temporary workspace" | ||
|
||
mkdir -p "$WORKSPACE" | ||
|
||
cd "$WORKSPACE" | ||
|
||
git clone git@github.com:npm/cli.git | ||
cd cli | ||
|
||
echo "Preparing npm release" | ||
|
||
git checkout v"$NPM_VERSION" | ||
make | ||
make release | ||
|
||
echo "Removing old npm" | ||
|
||
cd "$DEPS_DIR" | ||
rm -rf npm/ | ||
|
||
echo "Copying new npm" | ||
|
||
tar zxf "$WORKSPACE"cli/release/npm-"$NPM_VERSION".tgz | ||
|
||
echo "Deleting temporary workspace" | ||
|
||
rm -rf "$WORKSPACE" | ||
|
||
echo "" | ||
echo "All done!" | ||
echo "" | ||
echo "Please git add npm, commit the new version, and whitespace-fix:" | ||
echo "" | ||
echo "$ git add -A deps/npm" | ||
echo "$ git commit -m \"deps: upgrade npm to $NPM_VERSION\"" | ||
echo "$ git rebase --whitespace=fix master" | ||
echo "" |