Skip to content
This repository was archived by the owner on Dec 18, 2019. It is now read-only.

Conversation

@coolalexhuang
Copy link

Convert '/' to '' for file path in windows file system.

Convert '/' to '\' for file path
*/
function(files, done) {
return async.map(files, function(file, cb) {
//Convert '/' to '\'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a correct solution is to instead use something like path.join on the glob above.

Edit: https://github.com/isaacs/node-glob#windows
It looks like glob paths always need to be using forward slashes /, and glob internally returns paths made with path.join. I'm not sure why these slashes need to be converted to work on Windows.

I'm also uncomfortable with a regex based approach like this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants