Skip to content

Commit

Permalink
Merge pull request #1586 from erwinmombay/changelog-version
Browse files Browse the repository at this point in the history
add back --version flag to changelog task
  • Loading branch information
erwinmombay committed Jan 26, 2016
2 parents 179835b + 0ed00f7 commit 064b4cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build-system/tasks/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 ' +
Expand All @@ -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()
Expand All @@ -70,7 +73,7 @@ function getGitMetadata() {
if (isDryrun) {
return;
}
return submitReleaseNotes(version, gitMetadata.changelog);
return submitReleaseNotes(argv.version, gitMetadata.changelog);
})
.catch(errHandler);
}
Expand Down Expand Up @@ -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',
}
});

0 comments on commit 064b4cb

Please sign in to comment.