@@ -5,7 +5,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5
5
cd " ${SCRIPT_DIR} /.."
6
6
7
7
# Ensure a new version argument is provided
8
- if [ " $# " -lt 1 ]; then
8
+ if [[ " $# " -lt 1 ] ]; then
9
9
echo " Usage: ${0} <new-version> [--execute]"
10
10
exit 1
11
11
fi
@@ -19,14 +19,14 @@ if ! git diff-index --quiet HEAD --; then
19
19
fi
20
20
21
21
# Check if the --execute flag is passed
22
- if [ " ${2:- } " == " --execute" ]; then
22
+ if [[ " ${2:- } " == " --execute" ] ]; then
23
23
EXECUTE=1
24
24
else
25
25
echo " Dry-run mode: No changes will be committed or tagged. Use '--execute' to apply changes."
26
26
fi
27
27
28
28
# Validate semantic version format
29
- if ! [[ " $NEW_VERSION " =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
29
+ if ! [[ " ${ NEW_VERSION} " =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
30
30
echo " Error: Version must be in semantic format (e.g., 1.2.3)"
31
31
exit 1
32
32
fi
@@ -44,14 +44,14 @@ echo -e "Changes pending:\n---"
44
44
git diff
45
45
echo " ---"
46
46
47
- TAG_NAME=" v$NEW_VERSION "
47
+ TAG_NAME=" v${ NEW_VERSION} "
48
48
COMMIT_MESSAGE=" release: Bump version to ${NEW_VERSION} "
49
49
50
50
echo " Building the project with goreleaser..."
51
51
goreleaser build --clean --snapshot
52
52
echo " Project built successfully."
53
53
54
- if [ " $EXECUTE " = " 1" ]; then
54
+ if [[ " ${ EXECUTE} " = " 1" ] ]; then
55
55
echo " Executing changes..."
56
56
git add -u
57
57
git commit -m " ${COMMIT_MESSAGE} "
0 commit comments