Skip to content

Commit

Permalink
Merge pull request #51 from ErisDS/filename-fix
Browse files Browse the repository at this point in the history
Changing error message to report filename not path
  • Loading branch information
Mario Gutierrez committed Jan 23, 2014
2 parents ebb3a3a + 21382b8 commit 7b74631
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/hbs.js
Expand Up @@ -420,7 +420,7 @@ function _express3(filename, source, options, cb) {
source = fs.readFileSync(filename, 'utf8');
template = self.handlebars.compile(source);
// for error message
template.__filename = filename;
template.__filename = filename.substring(filename.lastIndexOf(path.sep) + 1, filename.length);
if (options.cache) {
self.cache[filename] = { source: source, template: template };
}
Expand Down
2 changes: 1 addition & 1 deletion test/issues.js
Expand Up @@ -179,7 +179,7 @@ describe('issue-49', function() {
var render = hb.express3({});
var locals = H.createLocals('express3', dirname, {});
render(dirname + '/error.hbs', locals, function(err, html) {
assert(err.stack.indexOf('/issues/49/error.hbs') > 0);
assert(err.stack.indexOf('error.hbs') > 0);
done();
});
});
Expand Down

0 comments on commit 7b74631

Please sign in to comment.