-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Disable creation of cmdShim PowerShell shims because they don't work and cause problems #6954
Conversation
Can create powershell file, not delete it? |
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 indeed correct for disabling PowerShell shim creation.
review?(@arcanis)
This will restore cmd shim creation behaviour to how it was before 1.13. |
Sounds good then - I'll merge this and release it with the 1.15.1 |
|
- Yarn's global folder can be set via `yarn config set global-folder` (yarnpkg/yarn#7056) and thus can be persisted. - ~~Since yarn's global bin creating procedure is still problematic (yarnpkg/yarn#6902, **fixed by yarnpkg/yarn#6954 The `.bin` folder in `global\node_modules` is a better path to add to env, and this can avoid the annoying problem when you install scoop in some place except `C:` (that the shims in global bin have wrong relative path pointer). - If you install yarn via `scoop install yarn`, the `Yarn` folder in `$env:LOCALAPPDATA` is useless, and when you uninstall `yarn`, the `.yarnrc` is unused, so the manifest add `uninstaller.script` to remove them when you uninstall. - For reconfiguration, please use `scoop update yarn -f` instead of `scoop reset yarn`. - Close #2969
So does this mean I can't use yarn to global install packages? |
Summary
Fixes #6902. The latest version of
@zkochan/cmd-shim
has built-in support for PowerShell shims, but they don't work correctly (even the correct .ps1 shims throw errors in PowerShell). In addition, due to the funky way that Yarn handles global binaries, every permutation of (no extension/cmd/ps1) gets created (e.g..cmd.ps1
,.cmd.cmd
, etc) as a shim. Prior to the update to@zkochan/cmd-shim
, Yarn suppressed this by renaming.cmd.cmd
to just.cmd
, which is not the most elegant solution, but it works. As a (temporary?) workaround to the broken PowerShell shims, this PR simply disables the creation of PowerShell shims altogether whenever Yarn calls@zkochan/cmd-shim
.Test plan
A new test was added in
__tests__/commands/global.js
(shouldn't create powershell shims
) which ensures that no PowerShell shims are created, and that the duplicate-extension files do not exist.