-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add script to run npm dist-tag (#3524)
- Loading branch information
1 parent
cd40908
commit b1c4e53
Showing
2 changed files
with
34 additions
and
0 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,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
# List all packages managed by Lerna | ||
packages=$(./node_modules/.bin/lerna list) | ||
|
||
# Get latest version of all packages | ||
version=$(node -pe 'JSON.parse(process.argv[1]).version' "$(cat lerna.json)") | ||
|
||
fixDistTag() { | ||
package=$1 | ||
echo fixing $package | ||
|
||
# List npm tags | ||
npm dist-tag ls $package | ||
|
||
# Update "latest" tag to correct version | ||
npm dist-tag add $package@$version latest | ||
} | ||
|
||
for i in $packages | ||
do | ||
fixDistTag $i | ||
done |