Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
Fix compiling files from absolute paths
Browse files Browse the repository at this point in the history
fixes gh-103
closes gh-118
  • Loading branch information
paularmstrong committed Oct 28, 2012
1 parent 2a65ea1 commit 73df080
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions lib/swig.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,6 @@ function getTemplate(source, options) {
exports.compileFile = function (filepath, forceAllowErrors) {
var tpl, get;

if (filepath[0] === '/') {
filepath = filepath.substr(1);
}

if (_config.cache && CACHE.hasOwnProperty(filepath)) {
return CACHE[filepath];
}
Expand Down
2 changes: 1 addition & 1 deletion tests/swig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('swig.compileFile', function () {
root: __dirname + '/templates',
allowErrors: true
});
expect(swig.compileFile('/' + __dirname + '/templates/included_2.html').render({ array: [1, 1] }))
expect(swig.compileFile(__dirname + '/templates/included_2.html').render({ array: [1, 1] }))
.to.equal('2');
});

Expand Down

0 comments on commit 73df080

Please sign in to comment.