From 55f99791b1f362d3cf6f8f3b1b5c93c8ea9b1b4f Mon Sep 17 00:00:00 2001 From: Hemal Patil Date: Tue, 29 Aug 2023 22:33:06 +0530 Subject: [PATCH] Do not exit when in watch mode Resolves #2378 --- src/lib/cli.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/cli.ts b/src/lib/cli.ts index 0be786f12..7bdf947e8 100644 --- a/src/lib/cli.ts +++ b/src/lib/cli.ts @@ -7,6 +7,7 @@ const ExitCodes = { ValidationError: 4, OutputError: 5, ExceptionThrown: 6, + Watching: 7, }; import * as td from "typedoc"; @@ -28,8 +29,10 @@ async function main() { ]); const exitCode = await run(app); - app.logger.verbose(`Full run took ${Date.now() - start}ms`); - process.exit(exitCode); + if (exitCode !== ExitCodes.Watching) { + app.logger.verbose(`Full run took ${Date.now() - start}ms`); + process.exit(exitCode); + } } catch (error) { console.error("TypeDoc exiting with unexpected error:"); console.error(error); @@ -80,7 +83,7 @@ async function run(app: td.Application) { await app.generateJson(project, json); } }); - return ExitCodes.Ok; + return ExitCodes.Watching; } const project = await app.convert();