From 061391e355d5266b9e85cc480c6c3ddcfdd91101 Mon Sep 17 00:00:00 2001 From: Joel Chen Date: Fri, 7 Jul 2017 19:49:54 -0700 Subject: [PATCH] fix update-changelog script --- lerna.json | 2 +- package.json | 2 +- tools/update-changelog.js | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lerna.json b/lerna.json index 3ca8a0d27..804fc219b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "lerna": "2.0.0-rc.5", + "lerna": "2.0.0", "version": "independent", "command.publish.config": { "ignore": [ diff --git a/package.json b/package.json index 02377fe2b..99675c38a 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "bluebird": "^3.5.0", - "lerna": "^2.0.0-rc.5", + "lerna": "^2.0.0", "lodash": "^4.17.2", "semver": "^5.3.0", "xclap": "^0.2.0", diff --git a/tools/update-changelog.js b/tools/update-changelog.js index 088a76958..9c8c0c171 100644 --- a/tools/update-changelog.js +++ b/tools/update-changelog.js @@ -40,12 +40,16 @@ const checkGitClean = () => { const processLernaUpdated = output => { // search for last commit that's Publish using lerna const lernaInfo = output.stderr.split("\n"); - const tagSig = "Comparing with tag"; + const tagSig = "Comparing with"; let tagIndex; - const tagLine = lernaInfo.find(x => { + let tagLine = lernaInfo.find(x => { tagIndex = x.indexOf(tagSig); return tagIndex >= 0; - }); + }).trim(); + + if (tagLine.endsWith(".")) { + tagLine = tagLine.substr(0, tagLine.length - 1); + } assert(tagLine, "Can't find last publish tag from lerna"); const tag = tagLine.substr(tagIndex + tagSig.length).trim();