From 24e4da31e77af3760b59dcef3e1e3f9adc874113 Mon Sep 17 00:00:00 2001 From: Robert Stoll Date: Tue, 16 Apr 2024 22:45:04 +0200 Subject: [PATCH] use exitIfArgIsNotVersion in existing scripts --- src/releasing/pre-release-checks-git.sh | 6 +----- src/releasing/prepare-next-dev-cycle-template.sh | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/releasing/pre-release-checks-git.sh b/src/releasing/pre-release-checks-git.sh index 97e90511..ace8c586 100755 --- a/src/releasing/pre-release-checks-git.sh +++ b/src/releasing/pre-release-checks-git.sh @@ -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 diff --git a/src/releasing/prepare-next-dev-cycle-template.sh b/src/releasing/prepare-next-dev-cycle-template.sh index 33e5e6cd..c8f0a8cd 100755 --- a/src/releasing/prepare-next-dev-cycle-template.sh +++ b/src/releasing/prepare-next-dev-cycle-template.sh @@ -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