mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-18 22:14:35 +01:00
The REPL passes os.environ to `claude -p`, so a PYTHONPATH set by the launcher reached every hook and every Bash call of the coached session. The old launcher did not do that. The launcher now runs `/usr/bin/python3 -P -m leetcode_coach.leetcode_repl` and relies on install.sh's editable install, the same way the Stop-hook shim does. A test now pins that the launcher sets no PYTHONPATH. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PjvF5DZG9JduSBYKxqyysi
18 lines
836 B
Bash
Executable File
18 lines
836 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# ============================================================================
|
|
# leetcode — coaching session in print mode, on the cheapest model.
|
|
# Print mode matters: the no-solution Stop gate can only withhold a reply
|
|
# from a client that waits for hooks, and the interactive TUI streams first.
|
|
# leetcode <url-or-slug> [what you are stuck on...]
|
|
#
|
|
# Symlinked from ~/.local/bin/leetcode. The package is found through
|
|
# install.sh's editable install, like the Stop-hook shim; no PYTHONPATH here,
|
|
# because the REPL passes its environment on to `claude -p` and every hook and
|
|
# Bash call of the coached session would inherit it. -P keeps cwd off sys.path.
|
|
# ============================================================================
|
|
|
|
set -euo pipefail
|
|
|
|
exec /usr/bin/python3 -P -m leetcode_coach.leetcode_repl "$@"
|