From 64cb7d456ff20b64293c19dc7da154fe943eb525 Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Mon, 26 Oct 2026 09:57:25 +0200 Subject: [PATCH] Print the whole abroad addresses report through a pipe. process.exit() right after console.log cut the JSON report off when stdout was a pipe, as when the CLI runs over ssh. --- scripts/update-abroad-addresses.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/update-abroad-addresses.ts b/scripts/update-abroad-addresses.ts index 8f5df53..3700daf 100644 --- a/scripts/update-abroad-addresses.ts +++ b/scripts/update-abroad-addresses.ts @@ -53,10 +53,14 @@ async function main(): Promise { return 0 } +// exitCode, not process.exit(): exiting at once cuts off a long report +// written to a pipe (e.g. over ssh). main().then( - (code) => process.exit(code), + (code) => { + process.exitCode = code + }, (e: Error) => { console.error(e instanceof AbroadAddressesInputError ? e.message : e) - process.exit(1) + process.exitCode = 1 }, )