Repository navigation
Exit after saving from the command line - #50
Conversation
hype deck.md --theme tokyo-night --save saved and then opened the editor, which offscreen meant waiting forever, so bin/prepare-trials never got past its first deck. --save now writes, reports and exits like an export, without needing a display. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex <noreply@openai.com>
[Medium impact] The PR appears safe to merge; the previous finding is fully addressed. Summary
Reviews (2) · Last reviewed commit: "Test that a save from the command line t..." · Reviewed by Greptile |
| def test_save_applies_a_theme_and_exits(self): | ||
| self.write('# One\n') | ||
| self.hype(self.deck, '--theme', 'paper', '--save') | ||
| self.assertIn('color_background: "#ffffff"', self.deck.read_text()) | ||
| self.assertIn('to save', self.hype('--theme', 'paper', '--save', code=1).stderr) |
There was a problem hiding this comment.
The new test covers a successful save and missing arguments, but neither call reaches a failed file save. A regression that reports success after savePath() fails could therefore pass unnoticed. Add a case with an existing deck containing an unclosed fence, and assert exit code 1, an error on stderr, and unchanged file contents.
There was a problem hiding this comment.
Added: the test now saves a deck with an unclosed code fence, which Hype refuses to write, and checks for exit 1, an error on stderr, and the file unchanged. Reporting success there is exactly the regression worth catching.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps both tests that #50 and this branch add at the same place in tests/test_cli.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hype deck.md --theme tokyo-night --saveapplied the theme and saved, then fell through to opening the editor.bin/prepare-trialsruns exactly that offscreen for each trial deck, so it saved the first one and then waited forever on a window nobody could see.--savenow behaves like the export options: it writes the file, prints the status, and exits 0 or 1 on whether the save succeeded, and it no longer needs a display. Without a presentation named it says so and fails, rather than saving whichever presentation was open last. The help line says what it does now, since it was only ever used for theme snapshots.No CI runs here yet: master has no workflow until #48 lands, and #48's needs omacom/omarchy-pkgs#2573. Merged onto #48 with that pull request's dependencies, the tests pass. This and #52 each add a test at the same place in
tests/test_cli.py, so whichever merges second conflicts there and keeps both.🤖 Generated by Opus 5.5 in Claude Code. Reviewed by Codex XHigh.