From 75368fd96d4a8e8854357599ff03bfb0c18c6c31 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sat, 25 Jan 2025 04:55:50 +0900 Subject: modified ftplugin/markdown.lua, modified bin/gitupdate --- ar/.local/bin/gitupdate | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'ar/.local/bin/gitupdate') diff --git a/ar/.local/bin/gitupdate b/ar/.local/bin/gitupdate index a214950..fbb6ebe 100755 --- a/ar/.local/bin/gitupdate +++ b/ar/.local/bin/gitupdate @@ -71,16 +71,26 @@ branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||') repo_root=$(git rev-parse --show-toplevel || echo ".") cd "$repo_root" -# Pull and rebase before pushing -git pull --rebase origin "$branch" - -# Check if the 'home' remote exists -if git remote | grep -q "^home$"; then - # Push to both 'home' and 'origin' - git push home "$branch" && git push origin "$branch" +if [ "$repo_root" = "${PASSWORD_STORE_DIR:-${HOME}/.password-store}" ]; then + if git remote | grep -q "^home$"; then + # Push to both 'home' and 'origin' + pass git push home "$branch" && pass git push origin "$branch" + else + # Push only to 'origin' + pass git push origin "$branch" + fi else - # Push only to 'origin' - git push origin "$branch" + # Pull and rebase before pushing + git pull --rebase origin "$branch" + + # Check if the 'home' remote exists + if git remote | grep -q "^home$"; then + # Push to both 'home' and 'origin' + git push home "$branch" && git push origin "$branch" + else + # Push only to 'origin' + git push origin "$branch" + fi fi printf "\n[repo] %s(%s): %s\n" "$(basename "$repo_root")" "$branch" "$message" -- cgit v1.2.3