Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions guillotine.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
#!/bin/sh
# GUILLOTINE v0.0.0
# GUILLOTINE v0.1.0
# Claude Code execution terminator
# One-way. No recovery. No discussion.

set -eu

git rev-parse --is-inside-work-tree >/dev/null 2>&1 || exit 2
# --- Input -----------------------------------------------------------------

INPUT="$(cat || true)"

[ -z "$INPUT" ] && {
printf '%s\n' "INVALID"
exit 1
}

# --- Preconditions ---------------------------------------------------------

git rev-parse --is-inside-work-tree >/dev/null 2>&1 || {
printf '%s\n' "GUILLOTINE: not a git repository" >&2
exit 2
}

# --- Termination -----------------------------------------------------------

# Null-delimited, space-safe
git status --porcelain=v1 -z | while IFS= read -r -d '' entry; do
git status --porcelain=v1 -z | while IFS= read -r -d "" entry; do
status=${entry%% *}
path=${entry#?? }

Expand All @@ -18,4 +34,5 @@ git status --porcelain=v1 -z | while IFS= read -r -d '' entry; do
rm -rf -- "$path"
done

exit 1
printf '%s\n' "TERMINATED"
exit 0