fix commit message not working for push script

This commit is contained in:
Peter 2023-08-06 21:43:41 +08:00
parent ea73dad06b
commit 85ccd5c828

View File

@ -10,14 +10,16 @@ generate_commit_message() {
get_new_posts get_new_posts
} }
commit_msg="$(generate_commit_message)"
# Check if there are any new or modified files to commit # Check if there are any new or modified files to commit
if [ -n "$(get_new_posts)" ]; then if [ -n "$(get_new_posts)" ]; then
# Add all new and modified files # Add all new and modified files
echo "$(generate_commit_message)" echo "$commit_msg"
git add $(get_new_posts) git add $(get_new_posts)
# Commit the changes with the generated message # Commit the changes with the generated message
git commit -m "$(generate_commit_message)" git commit -m "$commit_msg"
git push git push
echo "Changes committed successfully." echo "Changes committed successfully."
else else