mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
Add skipCI flag to release script (#13933)
This commit is contained in:
@@ -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');
|
||||
};
|
||||
|
||||
@@ -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)}`
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user