aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-11-05 00:42:05 -0400
committerBobby <[email protected]>2022-11-05 00:42:05 -0400
commita8eda402d295c16bcaf786abbd3a020fe6234b26 (patch)
tree3adb107457ae1483b0cc6c5747f1244d2c1ddda8
parent7298bf4535c1f9ca624997463c39c852549a63da (diff)
downloadtexty-a8eda402d295c16bcaf786abbd3a020fe6234b26.tar.xz
texty-a8eda402d295c16bcaf786abbd3a020fe6234b26.zip
feat:
-rwxr-xr-xcommit.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/commit.sh b/commit.sh
index 0643232..9ea9df3 100755
--- a/commit.sh
+++ b/commit.sh
@@ -116,9 +116,6 @@ then
read -p "Enter commit message: " message
fi
-# Add type to the message
-message="$type: $message"
-
# Check if the branch exists
if [ -z "$(git branch --list $branch)" ]
then
@@ -136,6 +133,8 @@ fi
# Check if type is valid
if [[ $type =~ ^(feat|fix|docs|style|refactor|perf|test|chore|revert)$ ]]
then
+ # Add type to the message
+ message="$type: $message"
# If type is valid, run commit function
commit $files $message $branch
else
@@ -143,6 +142,7 @@ else
read -p "Invalid type. Do you want to use the default type "feat"? (y/n): " useDefaultType
if [[ $useDefaultType =~ ^[Yy]$ ]] || [[ $useDefaultType =~ ^[Yy][Ee][Ss]$ ]]
then
+ message="$type: $message"
commit $files $message $branch
else
echo "Commit aborted"