-
Notifications
You must be signed in to change notification settings - Fork 113
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
Result paths are not normalized to platform #370
Comments
Works as expected. Users write patterns in POSIX-style. The result of the work is also presented in this style. The Node.js platform can work with POSIX-style paths even on Windows. I am ready to consider this functionality only if there are strong arguments. |
The problem is more obvious when you use To perform string substitution on an absolute path returned from fast-glob, I have to normalize the fast-glob result first (so that it matches the format returned by While path normalization is not a difficult task to accomplish, my expectation was that fast-glob would match the native If changes in this issue were to be made:
|
I agree that when using the In the case of relative paths, things are more complicated, since we use the |
Will be included in the Now, when the |
Environment
Actual behavior
Results from fast-glob use POSIX path separators, even when on Windows.
NOTE:
DEST files (absolute)
are all incorrect (still pointing to the SRC files), because string substitution failed to findC:\\Users\\JohnDoe\\src
in the paths returned from fast-glob.Expected behavior
I'd expect resulting file paths to be normalized (adhering to the platform-defined path separator).
Steps to reproduce
cd C:\Users\JohnDoe
node copyFiles.mjs
Code sample
Given the following directory structure of
C:\Users\JohnDoe
:C:\Users\JohnDoe\copyFiles.mjs
EDIT: 2022-08-23 - expanded example, expected results, and actual results to reflect
{ absolute: true }
configThe text was updated successfully, but these errors were encountered: