Skip to content

Commit

Permalink
Improve release script.
Browse files Browse the repository at this point in the history
Confirm the current branch matches the release branch.
  • Loading branch information
dfish3r committed Aug 14, 2024
1 parent fee6342 commit 55f937c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions release
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

function user_continue() {
read -p "Do you want to continue? [y/n]" -n 1 -r
echo
Expand All @@ -15,6 +17,10 @@ fi

PROJECT="cryptacular"
BRANCH="${1}"
if [ ! $(git rev-parse --abbrev-ref HEAD) = "${BRANCH}" ]; then
echo "The current branch must be ${BRANCH}"
exit
fi
RELEASE_VERSION="${2}"
if [[ ! "${RELEASE_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "<release-version> must be of the form 'MAJOR.MINOR.REVISION'"
Expand Down

0 comments on commit 55f937c

Please sign in to comment.