diff --git a/README.md b/README.md index 02d6de8..9769ac7 100644 --- a/README.md +++ b/README.md @@ -49,5 +49,5 @@ ``` ~ cd scripts -~ sh release.sh --minor [--major [--patch]] +~ ./release.sh --minor [--major [--patch]] ``` diff --git a/scripts/release.sh b/scripts/release.sh old mode 100644 new mode 100755 index 8325b2f..6adff8a --- a/scripts/release.sh +++ b/scripts/release.sh @@ -2,6 +2,11 @@ set -e +if [ $# -eq 0 ]; then + echo "Missing flag. Use --minor, --major or --patch" + exit 1 +fi + BRANCH="production-release" git fetch origin && \ @@ -13,25 +18,20 @@ echo "Fetched origin, created release-branch." NEW_TAG_D="-1" NEW_TAG=$NEW_TAG_D -if [ $# -eq 0 ]; then - echo "No arguments provided" - exit 1 -fi - for cmd in "$@" do case $cmd in "--major") echo "Incrementing Major Version" - NEW_TAG=$(sh ./semver.sh -v major) + NEW_TAG=$(./semver.sh -v major) ;; "--minor") echo "Incrementing Minor Version" - NEW_TAG=$(sh ./semver.sh -v minor) + NEW_TAG=$(./semver.sh -v minor) ;; "--patch") echo "Incrementing Patch Version" - NEW_TAG=$(sh ./semver.sh -v patch) + NEW_TAG=$(./semver.sh -v patch) ;; *) echo "No version specified" @@ -54,6 +54,4 @@ git tag -a "$NEW_TAG" -m "Production ${NEW_TAG}" && \ echo "Pushing branch $RELEASE_BRANCH" && \ git push origin --follow-tags "$RELEASE_BRANCH" && \ -echo "Don't forget to merge to main and Approve the deploy to the production environment!" - -exit 0 \ No newline at end of file +exit 0 diff --git a/scripts/semver.sh b/scripts/semver.sh old mode 100644 new mode 100755