health-check: change exit code on failure

This commit is contained in:
Karol Wypchlo 2021-06-16 11:32:52 +02:00
parent 72b8951704
commit 17dca691a4
1 changed files with 5 additions and 0 deletions

View File

@ -38,5 +38,10 @@ require("yargs/yargs")(process.argv.slice(2)).command(
.push(entry) // insert new record .push(entry) // insert new record
.remove(({ date }) => date < getYesterdayISOString()) // drop old records .remove(({ date }) => date < getYesterdayISOString()) // drop old records
.write(); .write();
// exit with code 1 if any of the checks report failure
if (checks.some(({ up }) => !up)) {
process.exit(1);
}
} }
).argv; ).argv;