@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.ts +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shetty4l/core",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Shared infrastructure primitives for Bun/TypeScript services",
5
5
  "repository": {
6
6
  "type": "git",
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(0);
107
+ const exitCode = (await handler(args, json)) ?? 0;
108
+ process.exit(exitCode);
109
109
  }