diff --git a/scripts/pre-commit-repl-check b/scripts/pre-commit-repl-check index 0169c01..6825d02 100755 --- a/scripts/pre-commit-repl-check +++ b/scripts/pre-commit-repl-check @@ -35,7 +35,7 @@ for orgfile in $CHANGED; do [ -f "$orgfile" ] || continue # Determine the tangle target from the org file's PROPERTY line - TANGLE=$(grep 'header-args.*:tangle' "$orgfile" | sed "s/.*:tangle //" | head -1) + TANGLE=$(grep 'header-args.*:tangle' "$orgfile" | sed "s/.*:tangle //" | head -1 || true) if [ -z "$TANGLE" ]; then echo "SKIP: $orgfile — no :tangle header" >&2 continue @@ -48,7 +48,7 @@ for orgfile in $CHANGED; do # Tangle the org file to lisp if ! emacs --batch -L "$PROJECT_DIR" --eval "(require 'ob-tangle)" \ --eval "(org-babel-tangle-file \"$ORG_DIR/$(basename "$orgfile")\")" \ - 2>/dev/null; then + /dev/null; then echo "FAIL: $orgfile — tangling failed" >&2 FAILED=1 continue @@ -62,7 +62,7 @@ for orgfile in $CHANGED; do # Compile the lisp file in the daemon. # We send a Lisp form that compiles the file and returns T or an error string. # Using format to avoid backquote/comma issues. - LISP_ABS=$(realpath "$LISP_FILE") + LISP_ABS=$(realpath "$LISP_FILE" 2>/dev/null || echo "$LISP_FILE") CODE=$(cat <<-LISPEOF (let ((*standard-output* (make-broadcast-stream)) (*error-output* (make-broadcast-stream)))