Dotnetup: add env command to update PathPreference mode#54545
Draft
dsplaisted wants to merge 3 commits into
Draft
Dotnetup: add env command to update PathPreference mode#54545dsplaisted wants to merge 3 commits into
env command to update PathPreference mode#54545dsplaisted wants to merge 3 commits into
Conversation
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.
Currently, this PR includes the changes from #54520 but adds a design doc for how to address #53742.
Implementation will be added later, probably to this PR.
Basically, this replaces the
defaultinstallcommand with anenvcommand.Proposal
Replace
dotnetup defaultinstall <user|system>with a noun-verbenvcommand familybacked by a renamed three-value
PathPreferenceenum:env setis idempotent — running it again with the same mode is a no-op (and is alsohow you re-sync after something else has clobbered your PATH; see the key scenario
below).
Modes:
none— Don't modify your environment; usedotnetup dotnetto invoke.shell— Wire dotnetup into your shell's profile file (only shells that loadprofiles see the user dotnet).
all— Wire dotnetup into your shell profile and your user-levelPATH/DOTNET_ROOT so cmd.exe, IDEs, and shortcuts also see it.
See the design doc for more.