Remove stale goenv shims from v2 installations during upgrade to v3#537
Merged
Conversation
0dbf728 to
ae66cb5
Compare
There was a problem hiding this comment.
Pull request overview
Adds logic to detect and remove a stale goenv shim left behind by v2 installations during upgrades to v3. The stale shim (a bash wrapper that hard-codes a Homebrew Cellar libexec/goenv path baked in at rehash time) shadows the new v3 binary on PATH, so the cleanup is wired into the four entry points users may take to install/upgrade. The PowerShell installer is also rewritten with Join-Path, a more robust Write-ColorOutput, TLS 1.2, and an auto-profile setup step.
Changes:
- Detect v2 shim by content match on
libexec/goenvand remove it frominstall.sh,install.ps1,scripts/swap/main.go, andcmd/root.go(PersistentPreRun). - Refactor
install.ps1to useJoin-Path, force TLS 1.2, switch toWrite-Host-based color output, and addInitialize-PowerShellProfile.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| install.sh | Adds post-install removal of v2 shim using grep fingerprint check. |
| install.ps1 | Adds shim cleanup, TLS 1.2 enforcement, Join-Path-based path building, refactored color output, and PowerShell profile auto-config. |
| scripts/swap/main.go | Removes stale v2 shim after swapping the goenv binary, falling back to ~/.goenv when GOENV_ROOT is unset. |
| cmd/root.go | In PersistentPreRun, silently removes a stale v2 goenv shim if found in the shims directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ae66cb5 to
78428ea
Compare
ChronosMasterOfAllTime
previously approved these changes
May 19, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
0ddd446 to
5356010
Compare
ChronosMasterOfAllTime
approved these changes
May 19, 2026
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.
No description provided.