Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add back --version flag to changelog task #1586

Merged
merged 1 commit into from
Jan 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
}
});