Skip to content

fix(mage): report PATH changes clearly during install - #320

Merged
jongio merged 1 commit into
mainfrom
fix/install-path-messaging
Jul 18, 2026
Merged

fix(mage): report PATH changes clearly during install#320
jongio merged 1 commit into
mainfrom
fix/install-path-messaging

Conversation

@jongio

@jongio jongio commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

mage install was adding the dev bin dir to the User PATH, but the output never confirmed it. The last PATH-related line users saw was Machine 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 Install target:

  1. The User PATH fallback ran SetEnvironmentVariable(..., 'User') but ignored its error, so a real failure was indistinguishable from success.
  2. There was no confirmation line and no "open a new terminal" guidance.

Changes

  • Print Added to Machine PATH. or Added to User PATH. on success.
  • Surface a warning with the actual error when the User PATH write fails, and point the user at re-running from an elevated terminal.
  • End the install with: open a new terminal, then dispatch-dev, because already-open shells keep the old PATH.

Verification

  • mage -l and go build ./...: pass
  • Full mage install re-ran green (all tests with the race detector, build, deploy) and printed the new hint
  • Confirmed a fresh shell resolves dispatch-dev to bin/dispatch-dev.exe

No behavior change to what gets written to PATH; this only fixes the reporting and error handling.

`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
@jongio
jongio merged commit f0728c7 into main Jul 18, 2026
2 checks passed
@jongio
jongio deleted the fix/install-path-messaging branch July 18, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant