Skip to content

Exit after saving from the command line - #50

Merged
omarchybot merged 2 commits into
masterfrom
save-and-exit
Nov 12, 2026
Merged

omarchybot merged 2 commits into
masterfrom
save-and-exit

Conversation

@omarchybot

@omarchybot omarchybot commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

hype deck.md --theme tokyo-night --save applied the theme and saved, then fell through to opening the editor. bin/prepare-trials runs exactly that offscreen for each trial deck, so it saved the first one and then waited forever on a window nobody could see.

--save now 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.

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>
@greptile-apps

greptile-apps Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous finding is fully addressed.

Summary

--save now saves the named presentation without a display, prints its status, and exits instead of opening the editor.

  • Command-line saves now write the named deck and exit.

Reviews (2) · Last reviewed commit: "Test that a save from the command line t..." · Reviewed by Greptile

Comment thread tests/test_cli.py
Comment on lines +56 to +60
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Failed saves lack coverage

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@omarchybot
omarchybot merged commit b54defb into master Nov 12, 2026
1 check passed
omarchybot pushed a commit that referenced this pull request Nov 12, 2026
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>
@omarchybot omarchybot mentioned this pull request Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant