From 28808078adfe846c705318e46637a8c30d332654 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 15 Jun 2016 14:49:46 +0200 Subject: [PATCH 1/2] Enable using common npm start script --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index bdf172d..666ff0d 100644 --- a/package.json +++ b/package.json @@ -20,5 +20,8 @@ "grunt-contrib-concat": "~0.3.0", "grunt-gitinfo": "~0.1.7", "grunt-template": "~0.2.3" + }, + "scripts": { + "start": "grunt" } } From 058fff8b34f2f62a33b800fb3974b9a7cdc4a42a Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 15 Jun 2016 14:50:09 +0200 Subject: [PATCH 2/2] Handle multiple tags in buildinfo --- Gruntfile.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 008b2b4..d4921fb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -22,10 +22,11 @@ module.exports = function(grunt) { var gi = grunt.config('gitinfo'); var lbc = gi.local.branch.current; - var tag = (gi.tag == '') ? 'no_tag' : gi.tag; + var tags = (gi.tag == '') ? 'no_tag' : gi.tag; + tags = tags.split('\n').join(','); var commitMsg = lbc.lastCommitMessage.slice(1, -1).split('\n')[0].replace(/"/g, '\\\"'); - var buildInfo = lbc.shortSHA + "/" + lbc.name + "/" + tag + + var buildInfo = lbc.shortSHA + "/" + lbc.name + "/" + tags + " (" + lbc.lastCommitTime.slice(1, -1) + "; \'" + commitMsg + "'"; return { 'build_info': buildInfo }; }