Repository navigation
feat(install): add the default install directory to the user PATH - #778
Merged
Merged
Conversation
On Windows the installer only printed a PATH command, so wright was not runnable after the install without manual steps. When the default install directory is used, add it to the user PATH and to the current session. A custom -InstallDir keeps the printed instruction, so installer tests and ad-hoc installs do not edit the real PATH.
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.
After
irm .../install.ps1 | iexthe user had to run a printed PowerShell command and open a new terminal beforewrightworked.With the default install directory,
install.ps1now appends it to the userPATHand to the current session's$env:Path. With a custom-InstallDirit still prints the instruction, soscripts/test-install*.ps1(which always pass-InstallDir) never touch the runner's real PATH.Not covered by CI for that reason: the default-directory branch. It was not run locally (no pwsh).
SetEnvironmentVariablerewrites aREG_EXPAND_SZuser PATH asREG_SZ, the same as the instruction the installer printed before.