ci: fix pre-push hook

This commit is contained in:
Hans Larsen 2018-08-16 20:37:26 -07:00
parent 744cfa4543
commit 3d80aa8010

View File

@ -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));
} }