Skip to content

Commit

Permalink
Merge pull request #483 from webcat12345/update-publish-script
Browse files Browse the repository at this point in the history
build(scripts): Update publish script with commit and tag option
  • Loading branch information
cmckni3 authored Nov 1, 2023
2 parents 7af89e9 + d03ba6c commit 21d97cf
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@
set -e

VERSION='invalid'
COMMIT="0"

Help()
{
# Display Help
echo "Add description of the script functions here."
echo
echo "Syntax: publish.sh [-v|h]"
echo "Syntax: publish.sh [-v|c|h]"
echo "options:"
echo "v Version of package to release"
echo "c Commit and tag"
echo "h Print this Help"
echo
}

while getopts ":hv:" option; do
while getopts ":hv:c:" option; do
case $option in
v) # Enter a name
v)
VERSION=$OPTARG;;
c)
COMMIT=$OPTARG;;
h) # display Help
Help
exit;;
Expand All @@ -39,6 +43,10 @@ npm version ${VERSION} --no-commit-hooks --no-git-tag-version --preid beta

popd

# git commit -am 'chore(version): Bump version'
if [ "$COMMIT" = "1" ]; then
echo "Commiting and tagging"

# git tag -a "${VERSION}" -m "Version ${VERSION}"
git commit -am 'chore(version): Bump version'

git tag -a "${VERSION}" -m "Version ${VERSION}"
fi

0 comments on commit 21d97cf

Please sign in to comment.