From 0ed00f7a2ff37c252b36fc6f85ac67ef69df03a6 Mon Sep 17 00:00:00 2001 From: Erwin Mombay Date: Tue, 26 Jan 2016 09:39:00 -0800 Subject: [PATCH] add back --version flag to changelog task --- build-system/tasks/changelog.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build-system/tasks/changelog.js b/build-system/tasks/changelog.js index 2b0667b57ee7..2281873dd06b 100644 --- a/build-system/tasks/changelog.js +++ b/build-system/tasks/changelog.js @@ -31,7 +31,6 @@ var git = require('gulp-git'); var gulp = require('gulp-help')(require('gulp')); var request = BBPromise.promisify(require('request')); var util = require('gulp-util'); -var version = require('../internal-version').VERSION; var GITHUB_ACCESS_TOKEN = process.env.GITHUB_ACCESS_TOKEN; var exec = BBPromise.promisify(child_process.exec); @@ -42,6 +41,7 @@ var suffix = isCanary ? '-canary' : ''; var branch = isCanary ? 'canary' : 'release'; var isDryrun = argv.dryrun; + function changelog() { if (!GITHUB_ACCESS_TOKEN) { util.log(util.colors.red('Warning! You have not set the ' + @@ -57,6 +57,9 @@ function changelog() { } function getGitMetadata() { + if (!argv.version) { + throw new Error('no version value passed in. See --version flag option.'); + } var gitMetadata = {}; return getLastGitTag() @@ -70,7 +73,7 @@ function getGitMetadata() { if (isDryrun) { return; } - return submitReleaseNotes(version, gitMetadata.changelog); + return submitReleaseNotes(argv.version, gitMetadata.changelog); }) .catch(errHandler); } @@ -252,5 +255,6 @@ gulp.task('changelog', 'Create github release draft', changelog, { options: { dryrun: ' Generate changelog but dont push it out', type: ' Pass in "canary" to generate a canary changelog', + version: ' The git tag and github release label', } });