[test(types)] add emojis 🧪

This commit is contained in:
Eshan Roy (Eshanized)
2024-06-16 02:20:31 +05:30
parent 2eea6c8a43
commit be31a33661

20
push.sh
View File

@@ -1,10 +1,7 @@
#!/bin/bash
# Stage all changes
git add .
# Define the conventional commit types
TYPES=("feat" "fix" "docs" "style" "refactor" "perf" "test" "build" "ci" "chore" "revert")
# Define the conventional commit types with emojis
TYPES=("feat 🎉" "fix 🐞" "docs 📚" "style 💅" "refactor 🔨" "perf ⚡️" "test 🧪" "build 🛠️" "ci 🤖" "chore 🧹" "revert ⏪️")
# Prompt the user to select a commit type
echo "Select a commit type:"
@@ -12,6 +9,14 @@ select type in "${TYPES[@]}"; do
break
done
# Extract the commit type and emoji from the selection
type_emoji=${type}
type=${type_emoji% *}
emoji=${type_emoji#* }
# Prompt the user to enter a scope (optional)
read -p "Enter a scope (optional): " scope
# Prompt the user to enter a short description
read -p "Enter a short description: " desc
@@ -19,7 +24,7 @@ read -p "Enter a short description: " desc
read -p "Enter a longer description (optional): " long_desc
# Create the commit message
commit_msg="[$type] $desc"
commit_msg="[$type($scope)] $desc $emoji"
# If a longer description was provided, add it to the commit message
if [ -n "$long_desc" ]; then
@@ -32,7 +37,8 @@ fi
echo "Commit message:"
echo "$commit_msg"
# Stage all changes
git add .
# Commit the changes with the conventional commit message
git commit -m "$commit_msg"