diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-21 12:48:38 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-21 12:48:38 +0900 |
| commit | 0deaa4692a4155c05748e043fdc458215f05acfa (patch) | |
| tree | 977a9213136f5cb9c5661505b316eedf5bfc5c85 | |
| parent | 90a02a8fb97b86ac1ab9f6711df4c1a30d976294 (diff) | |
modified bin/ppts
| -rwxr-xr-x | ar/.local/bin/ppts | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/ar/.local/bin/ppts b/ar/.local/bin/ppts index 387bcf7..e315367 100755 --- a/ar/.local/bin/ppts +++ b/ar/.local/bin/ppts @@ -67,7 +67,31 @@ if [ -z "$1" ]; then # Step 3: Push to origin (without content/) echo "Step 3: Pushing to origin (without content/)..." - git push origin master || exit 1 + # Temporarily disable pre-push hook since we already excluded content/ + hook_disabled=false + if [ -f .git/hooks/pre-push ]; then + mv .git/hooks/pre-push .git/hooks/pre-push.disabled + hook_disabled=true + fi + # Try normal push first + if git push origin master 2>/dev/null; then + # Push succeeded + : + else + # Push failed, try force push (origin may have diverged) + echo "Warning: Origin has diverged, using force push..." + git push origin master --force || { + # Restore hook if push failed + if [ "$hook_disabled" = true ] && [ -f .git/hooks/pre-push.disabled ]; then + mv .git/hooks/pre-push.disabled .git/hooks/pre-push + fi + exit 1 + } + fi + # Restore hook after successful push + if [ "$hook_disabled" = true ] && [ -f .git/hooks/pre-push.disabled ]; then + mv .git/hooks/pre-push.disabled .git/hooks/pre-push + fi echo "✓ Pushed to origin (without content/)" else echo "No changes to commit (excluding content/)" |
