Add skipCI flag to release script (#13933)

This commit is contained in:
Brian Vaughn
2018-10-23 15:05:14 -07:00
committed by GitHub
parent d1142995ee
commit 27c7c98684
3 changed files with 25 additions and 1 deletions
@@ -4,6 +4,8 @@
const chalk = require('chalk');
const http = require('request-promise-json');
const logUpdate = require('log-update');
const prompt = require('prompt-promise');
const {execRead, logPromise} = require('../utils');
// https://circleci.com/docs/api/v1-reference/#projects
@@ -46,5 +48,21 @@ module.exports = async params => {
if (params.local) {
return;
}
if (params.skipCI) {
logUpdate(chalk.red`Are you sure you want to skip CI? (y for yes, n for no)`);
const confirm = await prompt('');
logUpdate.done();
if (confirm === 'y') {
return;
} else {
throw Error(
chalk`
Cancelling release.
`
);
}
}
return logPromise(check(params), 'Checking CircleCI status');
};
+1 -1
View File
@@ -21,6 +21,6 @@ module.exports = async params => {
update(params),
`Updating checkout ${chalk.yellow.bold(
params.cwd
)} on branch ${chalk.yellow.bold(params.branch)}}`
)} on branch ${chalk.yellow.bold(params.branch)}`
);
};
+6
View File
@@ -43,6 +43,12 @@ const paramDefinitions = [
'The npm dist tag; defaults to [bold]{latest} for a stable' +
'release, [bold]{next} for unstable',
},
{
name: 'skipCI',
type: Boolean,
description:
'Skip Circle CI status check (requires confirmation)',
},
];
module.exports = {