mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-26 01:01:13 +08:00
ci: fix pre-push hook
This commit is contained in:
parent
744cfa4543
commit
3d80aa8010
@ -16,6 +16,8 @@ const emptySha = '0'.repeat(40);
|
|||||||
|
|
||||||
|
|
||||||
export default function (_: {}, logger: logging.Logger) {
|
export default function (_: {}, logger: logging.Logger) {
|
||||||
|
let validateCommitResult = 0;
|
||||||
|
|
||||||
// Work on POSIX and Windows
|
// Work on POSIX and Windows
|
||||||
const rl = readline.createInterface({
|
const rl = readline.createInterface({
|
||||||
input: process.stdin,
|
input: process.stdin,
|
||||||
@ -33,10 +35,10 @@ export default function (_: {}, logger: logging.Logger) {
|
|||||||
|
|
||||||
if (remoteSha == emptySha) {
|
if (remoteSha == emptySha) {
|
||||||
// New branch.
|
// New branch.
|
||||||
validateCommits({ base: localSha }, logger);
|
validateCommitResult = validateCommits({ base: localSha }, logger);
|
||||||
} else {
|
} else {
|
||||||
validateCommits({ base: remoteSha, head: localSha }, logger);
|
validateCommitResult = validateCommits({ base: remoteSha, head: localSha }, logger);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
rl.on('end', () => process.exit(0));
|
rl.on('end', () => process.exit(validateCommitResult));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user