fix(cask): parse font artifacts in Homebrew API JSON - #332
Open
olegdizus wants to merge 1 commit into
Open
Conversation
…llow-up)
The artifact-parsing if/else chain in parseCaskJsonArch handled
app, binary, pkg, uninstall, suite, and artifact stanzas but had no
branch for font. Font artifact objects (e.g.
{"font":["ttf/FiraCode-Bold.ttf"],...}) fell through silently,
leaving the parsed Cask with an empty artifacts array. Font casks
then reported install success while copying no files to
~/Library/Fonts/.
PR justrach#306 fixed the same class of bug for suite and artifact; font
was missed. The downstream install code (installCask,
installZipFontsDirect, fontArtifactsOnly) already handles .font
artifacts correctly — this branch makes them reachable.
Adds a regression test covering multi-stanza font cask parsing.
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.
Fixes #331
The artifact-parsing if/else chain in
parseCaskJsonArch(src/api/client.zig) handledapp,binary,pkg,uninstall,suite, andartifactstanzas but had no branch forfont. Font artifact objects (e.g.{"font":["ttf/FiraCode-Bold.ttf"],...}) fell through silently, leaving the parsedCaskwith an emptyartifactsarray. Font casks then reported install success while copying no files to~/Library/Fonts/.PR #306 fixed the same class of bug for
suiteandartifact(issue #303);fontwas missed. The downstream install code (installCask,installZipFontsDirect,fontArtifactsOnly) already handles.fontartifacts correctly — this branch makes them reachable.Fix
Add a
fontbranch to the artifact-parsing chain, following the same pattern asapp/pkg:Verification
Built and tested locally on v0.1.198 with Zig 0.16.0.
Before the fix,
nb install --cask font-fira-codereported success butphase=artifacts ms=0.00(empty loop) and no files landed in~/Library/Fonts/.After the fix, the fast path fires (
phase=fast_install) and all fonts are extracted:Also verified with
font-cascadia-code-nf.zig build testpasses, including a new regression test for multi-stanza font cask parsing.