Loading
feat(update): detect more install methods for the upgrade nudge
Expand DetectInstallMethod so the "new version available" banner prints a working upgrade command for eight additional install methods: mise, asdf, Snap, Nix, MacPorts, Chocolatey, scoop, and WinGet.
Why
Previously only Homebrew and go install were detected — every other install method fell into the unknown branch, which drops the Run: line from the banner and leaves users to figure out the upgrade path themselves.
The concrete case that motivated this: a comment on #8490 surfaces a Slack thread where a user on mise (~/.local/share/mise/shims/glab) sees no upgrade guidance. This MR fixes that case plus seven others already documented in docs/installation_options.md.
Scope
- Pure path inspection against the resolved executable path — no shellouts, no OS-specific branches.
- Windows-specific managers (Chocolatey, scoop, WinGet) match case-insensitively; the rest are case-sensitive.
- Snap match handles both
/snap/glab/...and/var/lib/snapd/snap/glab/...(the mount path used on Fedora/openSUSE where/snapisn't directly mounted).
Deliberately out of scope
- Detection of
apt/dpkg,rpm/dnf,pacman,apk, and Spack: all land at/usr/bin/glaband can't be disambiguated by path alone. Would require shelling out to the package manager or reading/etc/os-releaseand guessing — separate discussion on #8490. - The full self-update capability from the original issue (auto-download, atomic replace, mirror config). Separate comment on #8490 covers scope/lift.
Testing
- Extended
install_method_test.gowith a positive case per new detector; preserved the existing negative case that guards against substring-collisions on Homebrew. go test ./internal/commands/update/...— green.
Related to #8490.