Skip to content

Commit

Permalink
add release.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Nov 13, 2023
1 parent 88918e3 commit 1fff5c5
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions bin/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh

if [[ $(git status -s) ]]; then
echo "Working directory is not clean!"
git status -s
echo
fi

ps | grep "webpack" | grep -v grep | awk '{print $1}' | xargs kill

echo "Choose type of release:"
echo
echo " 1) Patch (default)"
echo " 2) Minor"
echo " 3) Major"
echo
read -n 1 -p "Please select a number or press Enter for a patch: " option
echo

case $option in
1) version=patch ;;
2) version=minor ;;
3) version=major ;;
*) version=patch ;;
esac

while true; do
read -p "Create $version version? (y/n) " continue
case $continue in
[Yy]*)
break
;;
[Nn]*)
exit 0
;;
*)
echo "Please only enter \"y\" or \"n\"."
;;
esac
done
echo

npm version $version
git push origin && git push origin --tags

0 comments on commit 1fff5c5

Please sign in to comment.