refactor: streamline PNG rendering by removing temporary file usage#6
Open
rajarshidattapy wants to merge 1 commit into
Open
refactor: streamline PNG rendering by removing temporary file usage#6rajarshidattapy wants to merge 1 commit into
rajarshidattapy wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #4
renderCardToPNG(internal/cli/freeze.go) builtfreeze --execute "cat " + tmpfile, which brokebolna agents view <id> --png out.pngtwo ways:catisn't on a standard Windows PATH, so--executehad nothing to run —--pngcouldn't work at all.--executestring, so any temp path with a space (e.g.C:\Users\John Doe\bolna-card-123.ansi) split into two args and failed — on any OS whose temp path contains a space.Fix
Pipe the ANSI card to freeze's stdin instead of shelling out to
cat. This is freeze's documentedcat art.ansi | freezeusage — it reads and auto-detects ANSI on stdin. Both bugs die at the root: nocatdependency, and no temp file at all, so there's no path that could contain a space.Also deletes the whole temp-file dance (
os.CreateTemp,WriteString,Close,defer Remove) — −12 lines, smaller than the file-arg approach the issue suggested.Verification
go build ./...,go vet,go test ./...all pass.