Skip to content

Commit

Permalink
Fix the root variable using the wrong slashes on Windows, foundation/…
Browse files Browse the repository at this point in the history
  • Loading branch information
gakimball committed Dec 7, 2015
1 parent 4c2dc37 commit e23c419
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/loadHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ module.exports = function(dir) {
var name = path.basename(helpers[i], '.js');

try {
if(this.Handlebars.helpers[name]){
if (this.Handlebars.helpers[name]){
delete require.cache[require.resolve(path.join(helpers[i]))];
this.Handlebars.unregisterHelper(name);
}

helper = require(path.join(helpers[i]));
this.Handlebars.registerHelper(name, helper);
}
catch (e) {
console.warn('Error when loading ' + name + '.js as a Handlebars helper.');
}
}
}
}
4 changes: 3 additions & 1 deletion lib/processRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ module.exports = function(page, root) {
relativePath += '/';
}

return relativePath;
// On Windows, Node uses a "\" for the separator
// However, web browsers use "/" no matter the platform
return relativePath.replace('\\', '/');
}

0 comments on commit e23c419

Please sign in to comment.