🔬 test: new test script

This commit is contained in:
eshanized
2025-01-06 23:35:39 +05:30
parent 4a6915c6a0
commit c25b838efb

View File

@@ -6,7 +6,7 @@
# Define the conventional commit types with new emojis # Define the conventional commit types with new emojis
TYPES=("🚀 feat" "🐛 fix" "📝 docs" "✨ style" "🛠 refactor" "⚡️ perf" "🔬 test" "🔧 build" "🤖 ci" "🧹 chore" "⏪ revert") TYPES=("🚀 feat" "🐛 fix" "📝 docs" "✨ style" "🛠 refactor" "⚡️ perf" "🔬 test" "🔧 build" "🤖 ci" "🧹 chore" "⏪ revert")
# Function to display an error and exit and # Function to display an error and exit
error_exit() { error_exit() {
echo -e "\033[1;31m[ERROR]\033[0m $1" echo -e "\033[1;31m[ERROR]\033[0m $1"
exit 1 exit 1
@@ -22,6 +22,11 @@ branch=$(git rev-parse --abbrev-ref HEAD)
echo "Pulling latest changes from remote branch '$branch'..." echo "Pulling latest changes from remote branch '$branch'..."
git pull origin "$branch" || error_exit "Failed to pull changes from the remote repository. Please resolve any conflicts manually." git pull origin "$branch" || error_exit "Failed to pull changes from the remote repository. Please resolve any conflicts manually."
# Check if there are changes to commit
if git diff --quiet && git diff --cached --quiet; then
error_exit "No changes detected to commit."
fi
# Prompt the user to select a commit type # Prompt the user to select a commit type
echo "Select a commit type:" echo "Select a commit type:"
select type in "${TYPES[@]}"; do select type in "${TYPES[@]}"; do
@@ -65,7 +70,7 @@ git add .
if git commit -m "$commit_msg"; then if git commit -m "$commit_msg"; then
echo -e "\033[1;32mCommit successful!\033[0m" echo -e "\033[1;32mCommit successful!\033[0m"
else else
error_exit "Commit failed." error_exit "Commit failed. Please check your changes and try again."
fi fi
# Push the changes to the remote repository # Push the changes to the remote repository