diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-25 04:55:50 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-25 04:55:50 +0900 |
| commit | 75368fd96d4a8e8854357599ff03bfb0c18c6c31 (patch) | |
| tree | a6c5acfe35c8e88b0f1a39a272cf6e713fd3fac6 /ar/.local/bin/gitupdate | |
| parent | e1962ff6d5aa5c613a1662c42dea61764f2e7134 (diff) | |
modified ftplugin/markdown.lua, modified bin/gitupdate
Diffstat (limited to 'ar/.local/bin/gitupdate')
| -rwxr-xr-x | ar/.local/bin/gitupdate | 28 |
1 files changed, 19 insertions, 9 deletions
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" |
