Skip to content

Commit

Permalink
style(build): Simplified banner string concatenation
Browse files Browse the repository at this point in the history
String concatenation changed to use array join.

Ref g-33
  • Loading branch information
netil committed Oct 26, 2015
1 parent 0707cf1 commit 65567c6
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
gitinfo: grunt.task.run("gitinfo"),
banner: "/**\n" +
"* <%= pkg.name %>\n" +
"* @version <%= pkg.version %>\n" +
"* @SHA-1 <%= gitinfo.local.branch.current.shortSHA %><%= /(?!^master$)(^.*$)/.test(gitinfo.local.branch.current.name) && ' ('+ RegExp.$1 +')' || '' %>\n" +
"*\n" +
"* <%= pkg.author %>; <%= pkg.name %> JavaScript library\n" +
"* http://egjs.navercorp.com/\n" +
"*\n" +
"* Released under the <%= pkg.licenses[0].type %> license\n" +
"* <%= pkg.licenses[0].url %>\n" +
"*/\n\n",
banner: ["/**",
"* <%= pkg.name %>",
"* @version <%= pkg.version %>",
"* @SHA-1 <%= gitinfo.local.branch.current.shortSHA %>" +
"<%= /(?!^master$)(^.*$)/.test(gitinfo.local.branch.current.name) " +
" && ' ('+ RegExp.$1 +')' || '' %>",
"*",
"* <%= pkg.author %>; <%= pkg.name %> JavaScript library",
"* http://egjs.navercorp.com/",
"*",
"* Released under the <%= pkg.licenses[0].type %> license",
"* <%= pkg.licenses[0].url %>",
"*/\n"].join("\n"),
jshint: {
files: ["Gruntfile.js", "*.js", "src/**/*.js" ],
options: {
Expand Down

0 comments on commit 65567c6

Please sign in to comment.