From 85ccd5c82862f2665021777acef871120e971922 Mon Sep 17 00:00:00 2001 From: Peter Date: Sun, 6 Aug 2023 21:43:41 +0800 Subject: [PATCH] fix commit message not working for push script --- push.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/push.sh b/push.sh index ca148eb..135e8e0 100755 --- a/push.sh +++ b/push.sh @@ -10,14 +10,16 @@ generate_commit_message() { get_new_posts } +commit_msg="$(generate_commit_message)" + # Check if there are any new or modified files to commit if [ -n "$(get_new_posts)" ]; then # Add all new and modified files - echo "$(generate_commit_message)" + echo "$commit_msg" git add $(get_new_posts) # Commit the changes with the generated message - git commit -m "$(generate_commit_message)" + git commit -m "$commit_msg" git push echo "Changes committed successfully." else