fix(cli): stop gram print from crashing when no browser opener is found #254
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!254
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/open-in-browser-error"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
openInBrowser()returnedtrueright afterspawn(), but a missing opener (noxdg-openon Linux) fails afterwards, as anerrorevent with no listener:gram printprinted "Opening in browser…" and then crashed with a stack trace.openInBrowser()now resolves to whether the opener started (spawnvserrorevent), sogram printshows its fallback message with the path of the file to open by hand. Checked on Bun and Node. The parameter is renamedtargetand takes an optionalplatform, for the test and forgram view --serve(dev/1.6), which opens a URL.Tests:
tests/printer.test.ts(missing opener resolves to false). Patch changeset included.