mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-22 15:02:11 +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) {
|
||||
let validateCommitResult = 0;
|
||||
|
||||
// Work on POSIX and Windows
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
@ -33,10 +35,10 @@ export default function (_: {}, logger: logging.Logger) {
|
||||
|
||||
if (remoteSha == emptySha) {
|
||||
// New branch.
|
||||
validateCommits({ base: localSha }, logger);
|
||||
validateCommitResult = validateCommits({ base: localSha }, logger);
|
||||
} 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