Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not exit when in watch mode #2379

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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