fix: can't update package-lock.json (#1442)

This commit is contained in:
Yongjie Zhao 2021-10-27 15:18:23 +01:00
parent b307716979
commit 7f5249eda0
1 changed files with 7 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#!/bin/bash
rootDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
lernaVersionArg="$1"
if [[ -z $lernaVersionArg ]]; then
@ -19,8 +20,14 @@ tag=v$(node -e "process.stdout.write(require('./lerna.json').version)");
message="chore: publish $tag"
# Update the lock file here
rm "$rootDir/package-lock.json"
npm i --package-lock-only
if [[ $? -ne 0 ]]; then
echo 'Can not update package-lock.json'
exit 1
fi
# Auto-tag and auto-commit like usual
git commit --all -m ${message}
git tag -a ${tag} -m ${tag}