Skip to content

Commit

Permalink
Windows name fix shouldn't just affect directories
Browse files Browse the repository at this point in the history
I initially created mozilla#761 to deal with incorrectly formatted paths, when precompiling in Windows. The original pull request only dealt with directories, this change also deals with file names.
  • Loading branch information
kim3er authored Aug 31, 2016
1 parent 4150590 commit 5f791ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/precompile.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ function precompile(input, opts) {
for(var i=0; i<templates.length; i++) {
var name = templates[i].replace(path.join(input, '/'), '');

name = name.replace(/\\/g, '/');

try {
precompiled.push( _precompile(
fs.readFileSync(templates[i], 'utf-8'),
Expand All @@ -108,6 +106,9 @@ function precompile(input, opts) {
}
}
}

var last = precompiled[precompiled.length - 1];
last.name = last.name.replace(/\\/g, '/');

return wrapper(precompiled, opts);
}
Expand Down

0 comments on commit 5f791ac

Please sign in to comment.