The Windows path.
Defaults to true. If true and the winPath passed has spaces, the returned string will be wrapped in quotes.
Single quotes will be used unless there are single quote characters within the path, in which case it will be wrapped in double quotes.
The wsl equivalent path.
Converts a windows path to a WSL path (Windows Subsystem for Linux) if it's an absolute path, otherwise returns it unchanged.
Normally you can use
path.resolve()to convert paths to whatever is appropriate for the OS, but if you're running on Windows and need to spawn a command withwsl yourCommand, then you'll want to use this function to convert any parameters that are paths so that they can be resolved within WSL. Because the intended use of this function is for passing params around, most use cases will also require paths with spaces or single quotes to be wrapped in quotes, sowrapInQuotesIfSpacesdefaults to true.