Skip to content

Commit

Permalink
use exitIfArgIsNotVersion in existing scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll committed Apr 16, 2024
1 parent 1bda1e9 commit 24e4da3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions src/releasing/pre-release-checks-git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ function preReleaseCheckGit() {
)

parseArguments params "" "$TEGONAL_SCRIPTS_VERSION" "$@"

if ! [[ -v branch ]]; then branch="main"; fi
exitIfNotAllArgumentsSet params "" "$TEGONAL_SCRIPTS_VERSION"

if ! [[ "$version" =~ $versionRegex ]]; then
die "%s should match vX.Y.Z(-RC...), was %s" "$versionParamPatternLong" "$version"
fi
exitIfArgIsNotVersion "$version" "$versionParamPatternLong"

exitIfGitHasChanges

Expand Down
5 changes: 1 addition & 4 deletions src/releasing/prepare-next-dev-cycle-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ function prepareNextDevCycleTemplate() {
if ! [[ -v beforePrFn ]]; then beforePrFn="beforePr"; fi
if ! [[ -v afterVersionUpdateHook ]]; then afterVersionUpdateHook=''; fi
exitIfNotAllArgumentsSet params "" "$TEGONAL_SCRIPTS_VERSION"

if ! [[ "$version" =~ $versionRegex ]]; then
die "version should match vX.Y.Z(-RC...), was %s" "$version"
fi
exitIfArgIsNotVersion "$version" "$versionParamPatternLong"
exitIfArgIsNotFunction "$beforePrFn" "$beforePrFnParamPatternLong"

exitIfGitHasChanges
Expand Down

0 comments on commit 24e4da3

Please sign in to comment.