From 855acc37a962bee6623dcb04dd40e50651843b08 Mon Sep 17 00:00:00 2001 From: Markus Rudolph Date: Wed, 29 May 2024 15:49:47 +0200 Subject: [PATCH] Add a status line at the end of execution --- scripts/check-links.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/check-links.ts b/scripts/check-links.ts index 756429df..4a3595f9 100644 --- a/scripts/check-links.ts +++ b/scripts/check-links.ts @@ -26,7 +26,14 @@ async function main() { const markdownFiles = await readMarkdownFiles(); const setOfUrls = classifyAsDocumentLinksOrAliases(markdownFiles); //await writeFile("existingLinks.txt", JSON.stringify([...setOfUrls.entries()], null, 2)); - return printMissingLinks(markdownFiles, setOfUrls); + const success = printMissingLinks(markdownFiles, setOfUrls); + if(success) { + console.log(chalk.greenBright('Success!')); + process.exit(0); + } else { + console.log(chalk.redBright('Failed!')); + process.exit(1); + } } function classifyAsDocumentLinksOrAliases(markdownFiles: MarkdownFile[]) { @@ -130,4 +137,4 @@ function urlToString(link: string): string { return url.toString(); } -main().then(success => process.exit(success ? 0 : 1)); \ No newline at end of file +main(); \ No newline at end of file