-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Handle global tool specially when prepending PSHome to PATH #24228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@adityapatwardhan I think we should not include the I guess the |
| // We're running PowerShell global tool. In this case the real entry executable should be the 'pwsh' | ||
| // or 'pwsh.exe' within the '../.dotnet/tools' folder, not what PSHome is pointing to. | ||
| // BTW, 13 is the length of '.dotnet/tools' | ||
| pshome = pshome[0..(index + 13)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is true for global tools that are installed globally with dotnet tool install -g. It can be installed to any path, but I agree that most people will install it globally. Maybe add this to comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thanks! I've updated the code to cover the scenario where the PowerShell global tool is installed to an arbitrary location.
PR Summary
Fix #24090
Handle global tool specially when prepending PSHome to the
PATHenvironment variable.When running PowerShell global tool, the real entry executable should be the
pwshorpwsh.exewithin the '../.dotnet/tools' folder, not whatPSHomeis pointing to.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.- [ ] Issue filed: