Skip to content

Commit ecca078

Browse files
committed
Validate version name in scripts
1 parent 0bcd23f commit ecca078

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

scripts/bump-version.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -Eeuo pipefail
44
CURRENT_PROJECT_VERSION="$1" # e.g. 2.75
55

66
[[ -z "$(git diff --staged)" ]] || { echo "git has staged changes; will not bump version"; exit 1; }
7+
[[ "${CURRENT_PROJECT_VERSION::1}" != "v" && "${CURRENT_PROJECT_VERSION::1}" != "V" ]] || { echo "using version name without v"; CURRENT_PROJECT_VERSION="${CURRENT_PROJECT_VERSION:1}"; }
78

89
sed -E -i '' "s/([_\s])VERSION = \"?[-0-9A-Za-z.]*\"?;$/\1VERSION = \"$CURRENT_PROJECT_VERSION\";/g" jitouch/Jitouch/Jitouch.xcodeproj/project.pbxproj
910
sed -E -i '' "s/([_\s])VERSION = \"?[-0-9A-Za-z.]*\"?;$/\1VERSION = \"$CURRENT_PROJECT_VERSION\";/g" prefpane/Jitouch.xcodeproj/project.pbxproj

scripts/sign-installer.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ OBJROOT=build/staging
88
PRODUCT_BUNDLE_IDENTIFIER="com.jitouch.Jitouch"
99
signing_cert="Developer ID Installer: Aaron Kollasch (5UQY3B3594)"
1010

11+
[[ "${CURRENT_PROJECT_VERSION::1}" != "v" && "${CURRENT_PROJECT_VERSION::1}" != "V" ]] || { echo "using version name without v"; CURRENT_PROJECT_VERSION="${CURRENT_PROJECT_VERSION:1}"; }
12+
1113
zip "${BUILT_PRODUCTS_DIR}/Jitouch.prefPane.zip" "${BUILT_PRODUCTS_DIR}/Jitouch.prefPane"
1214
xcrun notarytool submit "${BUILT_PRODUCTS_DIR}/Jitouch.prefPane.zip" --keychain-profile "aaron@kollasch.dev" --wait
1315
xcrun stapler staple "${BUILT_PRODUCTS_DIR}/Jitouch.prefPane"

0 commit comments

Comments
 (0)