Skip to content

Commit

Permalink
Prepare for release 2.0.0-beta13
Browse files Browse the repository at this point in the history
  • Loading branch information
rtfpessoa committed Apr 25, 2016
1 parent 2463cb0 commit dd7b1e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
15 changes: 10 additions & 5 deletions dist/diff2html.js
Original file line number Diff line number Diff line change
Expand Up @@ -2809,11 +2809,16 @@ process.umask = function() { return 0; };

HoganJsUtils.prototype._loadTemplate = function(templateKey) {
var template;
if (fs.readFileSync) {
var templatePath = path.join(templatesPath, templateKey);
var templateContent = fs.readFileSync(templatePath + '.mustache', 'utf8');
template = hogan.compile(templateContent);
templatesCache[templateKey] = template;

try {
if (fs.readFileSync) {
var templatePath = path.join(templatesPath, templateKey);
var templateContent = fs.readFileSync(templatePath + '.mustache', 'utf8');
template = hogan.compile(templateContent);
templatesCache[templateKey] = template;
}
} catch (e) {
console.error('Failed to read (template: ' + templateKey + ') from fs: ' + e.message);
}

return template;
Expand Down
Loading

0 comments on commit dd7b1e5

Please sign in to comment.