Skip to content

Commit

Permalink
Gruntfile.js: remove templates from banner string
Browse files Browse the repository at this point in the history
Simplify browserify's postBundleCB
  • Loading branch information
joseph-onsip committed Sep 30, 2014
1 parent 1a7c839 commit 1bb49b7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
module.exports = function(grunt) {

var pkg = grunt.file.readJSON('package.json');
var year = new Date().getFullYear()
var banner = '\
/*\n\
* SIP version <%= pkg.version %>\n\
* Copyright (c) 2014-<%= grunt.template.today("yyyy") %> Junction Networks, Inc <http://www.onsip.com>\n\
* SIP version ' + pkg.version + '\n\
* Copyright (c) 2014-' + year + ' Junction Networks, Inc <http://www.onsip.com>\n\
* Homepage: http://sipjs.com\n\
* License: http://sipjs.com/license/\n\
*\n\
Expand Down Expand Up @@ -55,12 +56,8 @@ module.exports = function(grunt) {
standalone: 'SIP'
},
postBundleCB: function (err, src, next) {
// prepend the banner and fill in placeholders
src = (banner + src).replace(/<%=(.*)%>/g, function (match, expr) {
// jshint evil:true
return eval(expr);
});
next(err, src);
// prepend the banner
next(err, banner + src);
}
}
},
Expand Down

0 comments on commit 1bb49b7

Please sign in to comment.