mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-14 17:43:52 +08:00
ci: validate is really async and validate-commits should return errorcode
Instead of process.exit() which is a bit premature
This commit is contained in:
parent
af3332126e
commit
47892d2e1b
@ -145,8 +145,9 @@ export default function (argv: ValidateCommitsOptions, logger: logging.Logger) {
|
|||||||
|
|
||||||
if (invalidCount > 0) {
|
if (invalidCount > 0) {
|
||||||
logger.fatal(`${invalidCount} commits were found invalid...`);
|
logger.fatal(`${invalidCount} commits were found invalid...`);
|
||||||
process.exit(1);
|
|
||||||
} else {
|
} else {
|
||||||
logger.info('All green. Thank you, come again.');
|
logger.info('All green. Thank you, come again.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return invalidCount;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ import validateBuildFiles from './validate-build-files';
|
|||||||
import validateCommits from './validate-commits';
|
import validateCommits from './validate-commits';
|
||||||
import validateLicenses from './validate-licenses';
|
import validateLicenses from './validate-licenses';
|
||||||
|
|
||||||
export default function (options: { verbose: boolean }, logger: logging.Logger) {
|
export default async function (options: { verbose: boolean }, logger: logging.Logger) {
|
||||||
let error = false;
|
let error = false;
|
||||||
|
|
||||||
logger.info('Running templates validation...');
|
logger.info('Running templates validation...');
|
||||||
@ -21,7 +21,7 @@ export default function (options: { verbose: boolean }, logger: logging.Logger)
|
|||||||
if (execSync(`git status --porcelain`).toString()) {
|
if (execSync(`git status --porcelain`).toString()) {
|
||||||
logger.error('There are local changes.');
|
logger.error('There are local changes.');
|
||||||
if (!options.verbose) {
|
if (!options.verbose) {
|
||||||
process.exit(1);
|
return 101;
|
||||||
}
|
}
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
@ -44,13 +44,15 @@ export default function (options: { verbose: boolean }, logger: logging.Logger)
|
|||||||
|
|
||||||
logger.info('');
|
logger.info('');
|
||||||
logger.info('Running license validation...');
|
logger.info('Running license validation...');
|
||||||
validateLicenses({}, logger.createChild('validate-commits'));
|
error = await validateLicenses({}, logger.createChild('validate-commits')) != 0;
|
||||||
|
|
||||||
logger.info('');
|
logger.info('');
|
||||||
logger.info('Running BUILD files validation...');
|
logger.info('Running BUILD files validation...');
|
||||||
validateBuildFiles({}, logger.createChild('validate-build-files'));
|
validateBuildFiles({}, logger.createChild('validate-build-files'));
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
process.exit(101);
|
return 101;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user