From 699f3c8e6a079489d0d577c155759c12a0df6232 Mon Sep 17 00:00:00 2001 From: Chris Thielen Date: Thu, 12 May 2016 20:29:21 -0500 Subject: [PATCH] Add --no-changelog option to release.js --- scripts/release.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/release.js b/scripts/release.js index e89c8f527..113cf0ff5 100755 --- a/scripts/release.js +++ b/scripts/release.js @@ -6,12 +6,14 @@ let _ = require('lodash'); var argv = require('yargs') .usage('Usage: $0 [options]') .command('packages', '[optional] Comma separated list of packages to build.') + .alias('c', 'no-changelog') + .describe('c', 'Do not update CHANGELOG.md') .alias('b', 'branch') .nargs('b', 1) .describe('b', 'Specify non-master branch to release from') .help('h') .alias('h', 'help') - .example('$0 --branch feature', 'Release all packages from "feature" branch') + .example('$0 --no-changelog --branch feature', 'Release all packages from "feature" branch') .argv; let path = require('path'); @@ -36,17 +38,19 @@ projects = projects.reduce((memo, key) => { memo[key] = true; return memo; }, {} echo('--> Checking working copy status...'); _exec(`node ${rootDir}/scripts/ensure_clean_master.js ${argv.branch || 'master'}`); -echo('--> Updating CHANGELOG...'); -_exec(`node ${rootDir}/scripts/update_changelog.js`); - -echo('--> Committing changelog...'); -commands.push(``); -commands.push(``); -commands.push(`################# To perform the release ################# `); -commands.push(``); -commands.push(`git commit -m "chore(*): Release prep - Update CHANGELOG" CHANGELOG.md`); -commands.push(`git tag ${version}`); -commands.push(`git push origin ${version}`); +if (!argv['no-changelog']) { + echo('--> Updating CHANGELOG...'); + _exec(`node ${rootDir}/scripts/update_changelog.js`); + + echo('--> Committing changelog...'); + commands.push(``); + commands.push(``); + commands.push(`################# To perform the release ################# `); + commands.push(``); + commands.push(`git commit -m "chore(*): Release prep - Update CHANGELOG" CHANGELOG.md`); + commands.push(`git tag ${version}`); + commands.push(`git push origin ${version}`); +} Object.keys(projects).map(project => {