From d9b337f8f6c7f6f33a789e8b65917a63e1899f07 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Tue, 3 Jun 2025 22:10:29 -0400 Subject: [PATCH] fix: only push on changed --- bin/joj3-forge-convert | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/joj3-forge-convert b/bin/joj3-forge-convert index 39e164f..93f84bd 100755 --- a/bin/joj3-forge-convert +++ b/bin/joj3-forge-convert @@ -5,12 +5,14 @@ REPO_PATH=/home/tt/.cache/$COURSE-config GIT_USER=$(whoami) GIT_HOSTNAME=$(hostname -s) GIT_EMAIL="${GIT_USER}@${GIT_HOSTNAME}" -git -C $REPO_PATH pull +git -C $REPO_PATH pull --rebase rsync -r --delete $REPO_PATH/home/tt/.config/ /home/tt/.config joj3-forge convert /home/tt/.config/joj rsync -r --delete /home/tt/.config/joj/ $REPO_PATH/home/tt/.config/joj git -C $REPO_PATH config user.name $GIT_USER git -C $REPO_PATH config user.email $GIT_EMAIL git -C $REPO_PATH add home/tt/.config/joj -git -C $REPO_PATH commit -m "chore: joj3-forge convert" -git -C $REPO_PATH push +if ! git -C "$REPO_PATH" diff --staged --quiet; then + git -C $REPO_PATH commit -m "chore: joj3-forge convert" + git -C $REPO_PATH push +fi