Skip to content

Commit

Permalink
Use simple require for version string
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Jan 20, 2015
1 parent 14b3b47 commit bb72fe2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 0 additions & 6 deletions Jakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,4 @@ publishTask('ejs', ['build'], function () {
]);
});

jake.Task['publish:updateVersionFiles'].on('complete', function (version) {
var code = fs.readFileSync('./lib/ejs.js').toString();
code = code.replace(/exports.VERSION = '.+'/m,
"exports.VERSION = '" + version + "'");
fs.writeFileSync('./lib/ejs.js', code);
});

3 changes: 2 additions & 1 deletion lib/ejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var fs = require('fs')
, jsCache = {}
, optInDataWarned = false
, scopeOptionWarned = false
, _VERSION_STRING = require('../package.json').version
, _DEFAULT_DELIMITER = '%'
, _REGEX_STRING = '(<%%)|(<%=)|(<%-)|(<%#)|(<%)|(%>)|(-%>)'
, _OPTS = [ 'cache', 'filename', 'delimiter', 'scope', 'context'
Expand Down Expand Up @@ -535,7 +536,7 @@ if (require.extensions) {
};
}

exports.VERSION = '2.1.4';
exports.VERSION = _VERSION_STRING;

/* istanbul ignore if */
if (typeof window != 'undefined') {
Expand Down

0 comments on commit bb72fe2

Please sign in to comment.