From ccef213a4a0ae27d27b8566fa3d62bd5a6539045 Mon Sep 17 00:00:00 2001 From: Chris Thielen Date: Sun, 7 May 2017 10:36:47 -0700 Subject: [PATCH] chore(artifacts): Use target angular-hybrid version in tag name --- scripts/artifact_tagging.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/artifact_tagging.js b/scripts/artifact_tagging.js index 5aa069e87..abf3a4a1b 100755 --- a/scripts/artifact_tagging.js +++ b/scripts/artifact_tagging.js @@ -3,15 +3,16 @@ let pkg = require('../package.json'); let version = pkg.version; +let hybridVersion = require('../../angular-hybrid/package.json').version; -require('shelljs/global'); +let shx = require('shelljs'); let readlineSync = require('readline-sync'); let fs = require('fs'); let path = require('path'); let util = require('./util'); let _exec = util._exec; -cd(path.join(__dirname, '..')); +shx.cd(path.join(__dirname, '..')); var widen = false; var coreDep = pkg.dependencies['@uirouter/core']; @@ -22,14 +23,17 @@ if (isNarrow && readlineSync.keyInYN('Widen @uirouter/core dependency from ' + c widen = false; } -if (!readlineSync.keyInYN('Ready to publish to ' + version + '-artifacts tag?')) { +let tagname = `${version}+hybrid-${hybridVersion}`; +tagname += readlineSync.question(`Suffix for tag ${tagname} (optional)?`); + +if (!readlineSync.keyInYN(`Ready to publish ${tagname} tag?`)) { process.exit(1); } util.ensureCleanMaster('master'); // then tag and push tag -_exec(`git checkout -b ${version}-artifacts-prep`); +_exec(`git checkout -b ${tagname}-prep`); pkg.dependencies['@uirouter/core'] = widenedDep; fs.writeFileSync("package.json", JSON.stringify(pkg, undefined, 2)); @@ -39,7 +43,7 @@ _exec('npm run package'); _exec(`git add --force lib lib-esm release package.json`); _exec(`git commit -m 'chore(*): commiting build files'`); -_exec(`git tag ${version}-artifacts`); -_exec(`git push -u origin ${version}-artifacts`); +_exec(`git tag ${tagname}`); +_exec(`git push -u origin ${tagname}`); _exec(`git checkout master`); -_exec(`git branch -D ${version}-artifacts-prep`); +_exec(`git branch -D ${tagname}-prep`);