-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
echo "Cur version: $(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[ ",]//g')" | ||
|
||
if [ -z "$1" ]; then | ||
echo "Please provide a version number as an argument." | ||
exit 1 | ||
fi | ||
|
||
echo "New version: $1" | ||
|
||
sed -i 's/"version": "[0-9]*\.[0-9]*\.[0-9]*"/"version": "'$1'"/g' package.json src/manifest.json | ||
|
||
# update package-lock.json | ||
npm install | ||
|
||
git add package.json src/manifest.json package-lock.json | ||
git commit -m "chore: v$1" | ||
|
||
git tag "v$1" | ||
|
||
git diff HEAD^ HEAD -U0 | ||
|
||
read -p "Push changes? [y/N] " -n 1 -r | ||
echo # new line | ||
|
||
if [[ $REPLY =~ ^[Yy]$ ]] | ||
echo "Pushing new version..." | ||
git push origin main | ||
git push origin --tags | ||
fi |