Doctor behavior
Replaced the directory-first check with executable resolution. The shim path passes when
~/.local/bin/gh is the first runnable gh found in PATH.
The doctor command now checks whether the managed shim is the first executable named gh,
instead of requiring ~/.local/bin to be the first directory in PATH.
Fixed a false warning in gh-forgejo-shim doctor. The user had ~/.local/bin
before the real Homebrew gh, but other harmless directories appeared earlier in PATH.
That should be valid because none of those earlier directories provided gh.
Replaced the directory-first check with executable resolution. The shim path passes when
~/.local/bin/gh is the first runnable gh found in PATH.
The doctor now warns when the file at the shim location exists but is not managed by this project,
or when another gh executable resolves before the managed shim.
Updated doctor tests to cover harmless earlier PATH directories, a competing earlier gh,
and an unmanaged file at the shim path.
The user's shell has Codex, npm, and bun paths before ~/.local/bin. That is common and does
not matter unless one of those directories contains a gh executable. The old doctor logic
treated that layout as suspicious even when which -a gh showed the shim winning correctly.
No changes were made to /Users/kell/.zshrc.
run_checks still verifies the wrapper exists and is marked as managed by gh-forgejo-shim.gh is found by scanning PATH in shell order.Path.samefile is used when possible so equivalent paths compare correctly.
The snippet below is rendered with the Diffs FileDiff component when available, with a static
fallback for offline viewing. Reference: Diffs documentation.
if wrapper.exists() and is_managed_shim(wrapper):
first_gh = _first_program("gh", values.get("PATH", ""))
if first_gh and _same_file(first_gh, wrapper):
detail = f"{wrapper} is the first gh in PATH"
ok = True
elif first_gh:
detail = f"gh resolves to {first_gh} before {wrapper}"
ok = False
Users no longer need ~/.local/bin to be literally first in PATH. The setup is
considered healthy as long as the managed shim is the first gh command the shell would run.
python3 -m unittest: passed, 34 tests.python3 -m compileall -q src tests: passed.[ok] shim path: /Users/kell/.local/bin/gh is the first gh in PATH.pipx copy must be refreshed before the user's normal gh-forgejo-shim doctor command sees this fix.No new follow-up Beads issues were needed for this targeted bug fix.