From be31a3366196f72cdc8b6b7f5d00954327835cb9 Mon Sep 17 00:00:00 2001 From: "Eshan Roy (Eshanized)" <148610067+eshanized@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:20:31 +0530 Subject: [PATCH] =?UTF-8?q?[test(types)]=20add=20emojis=20=F0=9F=A7=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- push.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/push.sh b/push.sh index 6a9a7e4..dfab264 100755 --- a/push.sh +++ b/push.sh @@ -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"