Ship the do-epic launcher, keep its transcripts out of the repo and in the backup list

This commit is contained in:
2026-11-18 22:36:02 +01:00
parent 776a852965
commit b769916928
5 changed files with 26 additions and 1 deletions
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import os
import pathlib
import sys
LAUNCHER = pathlib.Path(__file__).resolve()
sys.path.insert(0, str(LAUNCHER.parent))
from loop_effects import effects
from do_epic import main
from loop_state import paths
sys.exit(main.main(sys.argv[1:], os.environ, paths.paths_from(pathlib.Path.home()), LAUNCHER, effects.system_effects()))
+10
View File
@@ -2,6 +2,7 @@ import contextlib
import dataclasses
import io
import pathlib
import subprocess
import sys
import tempfile
import unittest
@@ -58,6 +59,15 @@ class DoEpicTest(unittest.TestCase):
return code, out.getvalue(), err.getvalue()
class TheLauncher(unittest.TestCase):
def test_the_repo_ships_a_do_epic_that_prints_its_help(self) -> None:
launcher = pathlib.Path(__file__).resolve().parents[1] / "do-epic"
ran = subprocess.run([str(launcher), "--help"], capture_output=True, text=True, timeout=60)
self.assertEqual((ran.returncode, ran.stdout.split(" ", 2)[2]), (0, main.HELP + "\n"))
tracked = subprocess.run(["git", "ls-files", "--error-unmatch", launcher.name], capture_output=True, cwd=launcher.parent)
self.assertEqual(tracked.returncode, 0, "bin/do-epic is not in the repo; .gitignore lists what it keeps")
class TheCommand(DoEpicTest):
def test_prints_the_help_for_anything_but_one_epic_key(self) -> None:
for argv, code in ((["--help"], 0), (["-h"], 0), ([], 1), (["abc"], 1), (["ABC-12", "ABC-13"], 1), (["--chunk", "x", "ABC-12"], 1), (["--chunk", "ABC-12"], 1)):
+1
View File
@@ -16,6 +16,7 @@ PRIVATE = [
"daemon.log",
"daemon/control.key",
"debug/a.txt",
"do-epic-transcripts/a/b.jsonl",
"file-history/a/b.md",
"history.jsonl",
"jobs/a/b.json",