Skip to content
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

Support target and src being on different drives (for example, E:, C:) #17

Closed
cspotcode opened this issue Jul 22, 2019 · 0 comments · Fixed by #18
Closed

Support target and src being on different drives (for example, E:, C:) #17

cspotcode opened this issue Jul 22, 2019 · 0 comments · Fixed by #18

Comments

@cspotcode
Copy link

cspotcode commented Jul 22, 2019

Users of npm-pwsh reported cmd-shim can't link across drives.
cspotcode/npm-pwsh#18
npm-pwsh is currently using cmd-shim, but I'd like to switch to @zkochan/cmd-shim. Unfortunately both libraries exhibit this limitation.

The problem can be generalized to handling when the target path must be absolute instead of relative.

This can be accomplished by modifying these 2 lines:
https://github.com/pnpm/cmd-shim/blob/master/index.js#L252
https://github.com/pnpm/cmd-shim/blob/master/index.js#L257

... to check if target is an absolute path. If it is, it means we're linking to a different drive letter, so use target verbatim. If not, prepend with %~dp0 just like the current behavior.

Related: npm#21

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 a pull request may close this issue.

1 participant