Merge pull request #882 from SkynetLabs/change-exit-code-on-failure

Change exit code on failure
This commit is contained in:
firyx 2021-06-16 11:55:57 +02:00 committed by GitHub
commit b81a6b82ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;