Fix windows compatibility Issue #207 #241
Merged
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.
Alternative fix for #207 instead of existing PR #215.
src/utils/fs.js
In the
readLink
method there is a comment here stating code was copied fromnpm
cli here.The copied code doesn't have a fallback when the file is not a symlink.
However when we look further in
npm
cli. The copied code is used in such a way here as there is a fallback similar to what @Bloodb0ne has proposed in #215.In #215 the
try/catch
is duplicated incmdShim
whereas here I simply use the already safereadLink
method.In this PR I also removed the unusedpath-is-inside
dependency.src/utils/symlinkPackageDependencies.js
In my testing I also received
... is not a symlink
error insymlinkPackageDependencies
for workspace packages that exposed bin scripts. In lerna these shims are not symlinks here and considered to be packages that were erroneously installed. They are removed here before relinking.In
bolt
I suspect it is correct to read the shim as if it is a symlink and continue, similar to what is done incmdShim
(as discussed above). From what I can seebolt
then tries to recreate the shim here which is presumably idempotent.