Files
claude-config/bin/claude_release/main.py
T

17 lines
1.0 KiB
Python

import pathlib
import sys
from loop_effects.effects import Effects
from claude_home.home import SIGNED_OUT
# The spelling, a command of its own beside build-release: a panel of readers seated as the README's audience rejected `build-release claude`, since build-release reads every word after its name as a task, so a task that starts with "claude" would mean something else. They picked the name that opens with the word they look for.
def main(argv: list[str], cwd: pathlib.Path, effects: Effects) -> int:
"""Runs claude on the terminal in cwd with argv as its arguments, in the loop's Claude home with the release's tools first on `PATH`, which the effect sets for every claude it starts. Returns claude's exit code, or 1 where the home cannot be built."""
not_ready = effects.claude_home()
# Where nobody has signed in yet, the login is typed in this claude.
if not_ready and not not_ready.startswith(SIGNED_OUT):
print(not_ready, file=sys.stderr)
return 1
return effects.claude_on_terminal(argv, str(cwd), {})