Skip to content

Commit

Permalink
Do not exit when in watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
HemalPatil committed Aug 29, 2023
1 parent 6f3fb57 commit 55f9979
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const ExitCodes = {
ValidationError: 4,
OutputError: 5,
ExceptionThrown: 6,
Watching: 7,
};

import * as td from "typedoc";
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 55f9979

Please sign in to comment.