fix(mage): report PATH changes clearly during install - #320
Merged
Conversation
`mage install` added the dev bin dir to the User PATH but never said so: the last PATH line users saw was "Machine PATH failed (need admin), trying User PATH..." with no confirmation, and the User PATH fallback swallowed its error, so a genuine failure looked identical to success. Users reasonably concluded install did not touch PATH. - Print "Added to Machine PATH." / "Added to User PATH." on success. - Surface a warning (with the error) when the User PATH write actually fails, instead of failing silently. - End the install with a hint: open a new terminal, then `dispatch-dev`, since already-open shells keep the old PATH. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 524cf702-8922-4cfd-b23f-4069b734e09b
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
mage installwas adding the dev bin dir to the User PATH, but the output never confirmed it. The last PATH-related line users saw wasMachine PATH failed (need admin), trying User PATH..., which reads like an error. There was no success message and no hint that a new terminal is needed, so it looked like install did not touch PATH at all.Two concrete problems in the
Installtarget:SetEnvironmentVariable(..., 'User')but ignored its error, so a real failure was indistinguishable from success.Changes
Added to Machine PATH.orAdded to User PATH.on success.dispatch-dev, because already-open shells keep the old PATH.Verification
mage -landgo build ./...: passmage installre-ran green (all tests with the race detector, build, deploy) and printed the new hintdispatch-devtobin/dispatch-dev.exeNo behavior change to what gets written to PATH; this only fixes the reporting and error handling.