Skip to content

Commit

Permalink
Merge pull request #211 from sakabako/master
Browse files Browse the repository at this point in the history
Fix paths relative to current directory
  • Loading branch information
SlexAxton committed Nov 4, 2014
2 parents b3f4c99 + 79fcd9e commit 6e0ba17
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hbs.js
Expand Up @@ -422,13 +422,15 @@ define([
function cleanPath(path) {
var tokens = path.split('/');
for(var i=0;i<tokens.length; i++) {
if(tokens[i] == '..') {
if(tokens[i] === '..') {
delete tokens[i-1];
delete tokens[i];
} else if (tokens[i] === '.') {
delete tokens[i];
}
}
return tokens.join('/').replace(/\/\/+/g,'/');
};
}

function fetchAndRegister(langMap) {
fetchText(path, function(text, path) {
Expand Down

0 comments on commit 6e0ba17

Please sign in to comment.