@shetty4l/core 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.ts +3 -3
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -45,7 +45,7 @@ export function formatUptime(seconds: number): string {
|
|
|
45
45
|
export type CommandHandler = (
|
|
46
46
|
args: string[],
|
|
47
47
|
json: boolean,
|
|
48
|
-
) => void | Promise<void>;
|
|
48
|
+
) => void | number | Promise<void | number>;
|
|
49
49
|
|
|
50
50
|
export interface RunCliOpts {
|
|
51
51
|
/** Service name, used in error messages. */
|
|
@@ -104,6 +104,6 @@ export async function runCli(opts: RunCliOpts): Promise<void> {
|
|
|
104
104
|
process.exit(1);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
await handler(args, json);
|
|
108
|
-
process.exit(
|
|
107
|
+
const exitCode = (await handler(args, json)) ?? 0;
|
|
108
|
+
process.exit(exitCode);
|
|
109
109
|
}
|