diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-21 03:50:27 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-21 03:50:27 +0900 |
| commit | ce6bde63e93204f76f229e7384b29a191e4d5bf6 (patch) | |
| tree | 1719d9c0433e96bccc2e349e2f7edfc8777ba0f3 | |
| parent | 18e7e74b4ecd6075937a2f9294b7f1203b909d8d (diff) | |
created bin/ppts
| -rwxr-xr-x | mac/.local/bin/ppts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mac/.local/bin/ppts b/mac/.local/bin/ppts new file mode 100755 index 0000000..bde60df --- /dev/null +++ b/mac/.local/bin/ppts @@ -0,0 +1,32 @@ +#!/bin/sh + +# Wrapper script for git push that handles content/ directory exclusion +# Usage: ppts <remote> <branch> [other git push options] + +remote="$1" +shift + +# Run git push +git push "$remote" "$@" +push_exit_code=$? + +# If push was successful and we pushed to origin, restore content/ +if [ "$push_exit_code" -eq 0 ] && [ "$remote" = "origin" ]; then + if [ -f .git/hooks/.pre-push-state ]; then + echo "Restoring content/ directory..." + + # Read the stored HEAD and temp commit + original_head=$(head -n 1 .git/hooks/.pre-push-state) + + # Reset to original HEAD (this will restore content/) + if [ -n "$original_head" ] && git rev-parse --verify "$original_head" >/dev/null 2>&1; then + git reset --soft "$original_head" >/dev/null 2>&1 + echo "content/ directory restored to git index" + fi + + # Clean up state file + rm -f .git/hooks/.pre-push-state + fi +fi + +exit "$push_exit_code" |
