Web Update
This commit is contained in:
91
scripts/commit_local.sh
Executable file
91
scripts/commit_local.sh
Executable file
@@ -0,0 +1,91 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Local Git Commit Script
|
||||
# This script commits changes to the local repository
|
||||
|
||||
echo "===================================="
|
||||
echo "Local Git Commit Script"
|
||||
echo "===================================="
|
||||
echo ""
|
||||
|
||||
# Show current status
|
||||
echo "Current Git Status:"
|
||||
git status
|
||||
echo ""
|
||||
|
||||
# Ask user for commit type
|
||||
echo "Select what to commit:"
|
||||
echo "1) All changes (including logs)"
|
||||
echo "2) Code changes only (exclude logs)"
|
||||
echo "3) Custom selection"
|
||||
read -p "Enter your choice (1-3): " choice
|
||||
|
||||
case $choice in
|
||||
1)
|
||||
echo ""
|
||||
echo "Adding all changes..."
|
||||
git add .
|
||||
;;
|
||||
2)
|
||||
echo ""
|
||||
echo "Adding code changes (excluding logs)..."
|
||||
git add frontend/public/favicon*.png
|
||||
git add frontend/public/android-chrome-*.png
|
||||
git add frontend/public/apple-touch-icon.png
|
||||
git add frontend/public/manifest.json
|
||||
git add frontend/public/favicon.ico
|
||||
git add frontend/public/index.html
|
||||
git add frontend/src/components/cards/ProductCard.js
|
||||
git add frontend/src/pages/About.js
|
||||
git add frontend/src/pages/Products.js
|
||||
git add backend/create_favicons.py
|
||||
git add backend/update_hero_image.py
|
||||
;;
|
||||
3)
|
||||
echo ""
|
||||
echo "Enter the files/folders to add (space-separated):"
|
||||
read -p "> " files
|
||||
git add $files
|
||||
;;
|
||||
*)
|
||||
echo "Invalid choice. Exiting."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ""
|
||||
echo "Staged changes:"
|
||||
git status
|
||||
echo ""
|
||||
|
||||
# Get commit message from user
|
||||
read -p "Enter commit message: " commit_message
|
||||
|
||||
if [ -z "$commit_message" ]; then
|
||||
echo "Error: Commit message cannot be empty."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Commit the changes
|
||||
echo ""
|
||||
echo "Committing changes..."
|
||||
git commit -m "$commit_message"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo ""
|
||||
echo "✓ Changes committed successfully!"
|
||||
echo ""
|
||||
echo "Current status:"
|
||||
git log -1 --oneline
|
||||
echo ""
|
||||
git status
|
||||
else
|
||||
echo ""
|
||||
echo "✗ Commit failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "===================================="
|
||||
echo "Commit completed successfully!"
|
||||
echo "===================================="
|
||||
37
scripts/quick_commit.sh
Executable file
37
scripts/quick_commit.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Quick Git Commit Script
|
||||
# Usage: ./quick_commit.sh "Your commit message"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: ./quick_commit.sh \"Your commit message\""
|
||||
echo ""
|
||||
echo "Current changes:"
|
||||
git status --short
|
||||
exit 1
|
||||
fi
|
||||
|
||||
COMMIT_MSG="$1"
|
||||
|
||||
echo "Adding all changes (excluding logs)..."
|
||||
|
||||
# Add specific files (excluding logs)
|
||||
git add frontend/public/*.png
|
||||
git add frontend/public/*.ico
|
||||
git add frontend/public/manifest.json
|
||||
git add frontend/public/index.html
|
||||
git add frontend/src/
|
||||
git add backend/*.py
|
||||
|
||||
echo ""
|
||||
echo "Committing: $COMMIT_MSG"
|
||||
git commit -m "$COMMIT_MSG"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo ""
|
||||
echo "✓ Committed successfully!"
|
||||
git log -1 --oneline
|
||||
else
|
||||
echo ""
|
||||
echo "✗ Commit failed or nothing to commit"
|
||||
fi
|
||||
Reference in New Issue
Block a user