Skip to content
This repository has been archived by the owner on Feb 17, 2019. It is now read-only.

Using path.normalize and path.sep to overcome windows issues #38

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/broccoli_sass_compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ BroccoliSassCompiler.prototype.handleCacheHit = function(details, inputAndOutput
BroccoliSassCompiler.prototype.scopedFileName = function(file) {
file = this.relativize(file);
if (this.treeName) {
return this.treeName + "/" + file;
return this.treeName + path.sep + file;
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use path.join instead?

return path.join(this.treeName, file);

Copy link

Choose a reason for hiding this comment

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

Is there anything we can do to make this happen? This is a bit of a show stopper on Windows!

Copy link
Author

Choose a reason for hiding this comment

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

Sorry for abandoning this PR, don't have an env suitable for testing anymore
You could probably apply a change, proposed above and test, I don't think it is the only place where paths are concatenated as strings, but it will be enough to make this PR accepted, hopefully.

} else {
return file;
}
Expand Down Expand Up @@ -680,6 +680,11 @@ BroccoliSassCompiler.prototype.filesInTree = function(srcPath) {
var pattern = path.join(srcPath, sassDir, sourceFile);
files = files.concat(glob.sync(pattern));
});

files = files.map(function(rawPath){
return path.normalize(rawPath);
});

return unique(files);
};

Expand Down