-
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
Support Windows paths for pnp. #6447
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -396,11 +396,16 @@ export default class Config { | |
} | ||
|
||
if (process.platform === 'win32') { | ||
if (this.plugnplayEnabled) { | ||
this.reporter.warn(this.reporter.lang('plugnplayWindowsSupport')); | ||
const cacheRootFolderDrive = path.parse(this._cacheRootFolder).root; | ||
const lockfileFolderDrive = path.parse(this.lockfileFolder).root; | ||
|
||
if (cacheRootFolderDrive !== lockfileFolderDrive) { | ||
if (this.plugnplayEnabled) { | ||
this.reporter.warn(this.reporter.lang('plugnplayWindowsSupport')); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now may be a good time to think on other platform specific path things that might make relative paths less portable from platform to platform. Off the top of my head there is also long paths (namespaced paths) in Windows. Update: I think the root check above may already handle namespaced paths. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess if the need arise we could just have a |
||
this.plugnplayEnabled = false; | ||
this.plugnplayPersist = false; | ||
} | ||
this.plugnplayEnabled = false; | ||
this.plugnplayPersist = false; | ||
} | ||
|
||
this.plugnplayShebang = String(this.getOption('plugnplay-shebang') || '') || '/usr/bin/env node'; | ||
|
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.
There should be a case-insensitive check.
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.
Makes sense! Can you open a PR?
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.
It looks like both
cacheRootFolder
andlockfileFolder
can be user customized. Would it make more sense for user-provided values to be normalized at time of ingestion to avoid these kinds of one-off normalizations in other places in the code as well?