Repository navigation
refactor: shorten Raycast binary lookup and tidy sources - #7
Merged
Merged
Conversation
- raycast: replace the hand-written candidate loop in all five scripts with path+= and whence -p. Lookup order is unchanged: FERRY_BINARY, the inherited PATH, /opt/homebrew/bin, /usr/local/bin, ~/.local/bin, then build/ next to raycast/. - src/ferry.m: make the verbose flag a local in main instead of a file-scope global. - tests/follow.m: name the fullscreen space type instead of using 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P1i79aMaG5M7eTyaXZuVS9
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.
Summary
Maintenance pass looking for unnecessary tests and code that is hard to maintain long-term. The repo is already lean (the demo was removed in #5), so the changes are small:
if/elifchain plus aforloop over candidates). It is replaced withpath+=(...)+whence -p ferry, so each script drops from 39 to 24 lines. Scripts stay self-contained so the README's "copy the five files" / "copy a script for Space 6+" workflow still works. Lookup order is unchanged:FERRY_BINARY→ inheritedPATH→/opt/homebrew/bin→/usr/local/bin→~/.local/bin→build/next toraycast/. The missing-binary message and exit status 127 are unchanged.g_verbosewas a file-scope global used only insidemain; it is now a local.SPACE_TYPE_FULLSCREEN) instead of using the literal4twice, matchingferry.m.Reviewed and kept
tests/cli.sh: each case covers a distinct argument-parsing branch (non-numeric, zero, overflow, missing value, unknown option, extra index). None are redundant.tests/follow.m: manual-only, but it is the only test of real move and Follow behavior (the issue docs: default version bump to patch in AGENTS.md #2 regression).macho_find_symboland the focus code mirror yabai and stay as they are, per AGENTS.md "upstream first".Test plan
build/fallback,~/.local/binbeatingbuild/,PATHbeating fallbacks,FERRY_BINARYwinning, a missingFERRY_BINARYerroring, and invocation from another cwd. All match the old order..mchanges could not be compiled locally (Linux container). CI builds them on macOS 26 with-Werror.🤖 Generated with Claude Code
https://claude.ai/code/session_01P1i79aMaG5M7eTyaXZuVS9
Generated by Claude Code