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

Fix windows compatibility Issue #207 #241

Merged
merged 1 commit into from
Sep 12, 2019

Conversation

bholloway
Copy link
Contributor

@bholloway bholloway commented Aug 16, 2019

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 from npm 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 in cmdShim whereas here I simply use the already safe readLink method.

In this PR I also removed the unused path-is-inside dependency.

src/utils/symlinkPackageDependencies.js

In my testing I also received... is not a symlink error in symlinkPackageDependencies 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 in cmdShim (as discussed above). From what I can see bolt then tries to recreate the shim here which is presumably idempotent.

@bholloway bholloway force-pushed the fix-windows-cmdshim branch from 9bcf3cc to 2818eb8 Compare August 16, 2019 05:17
@bholloway
Copy link
Contributor Author

Ping @lukebatchelor

@bholloway
Copy link
Contributor Author

The CI is failing Node 4. Seems to be a known issue with yarn@latest.

@lukebatchelor
Copy link
Member

LGTM! Thanks heaps @bholloway. Let me run this past Jamie quickly and we'll get this merged and released.

@lukebatchelor
Copy link
Member

Ping @jamiebuilds . Looks G to me. You happy to merge?

@lukebatchelor lukebatchelor merged commit ef81499 into boltpkg:master Sep 12, 2019
@lukebatchelor
Copy link
Member

Thanks heaps @bholloway

Released in 0.24.1

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 this pull request may close these issues.

2 participants