mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-13 11:22:11 +02:00
24 lines
828 B
TypeScript
24 lines
828 B
TypeScript
|
|
import type { Command } from '@commander-js/extra-typings';
|
||
|
|
import type { KloCliCommandContext } from '../cli-program.js';
|
||
|
|
import { resolveCommandProjectDir } from '../cli-program.js';
|
||
|
|
|
||
|
|
export function registerStatusCommands(program: Command, context: KloCliCommandContext): void {
|
||
|
|
program
|
||
|
|
.command('status')
|
||
|
|
.description('Show current KLO project setup status')
|
||
|
|
.option('--json', 'Print JSON output', false)
|
||
|
|
.action(async (options: { json?: boolean }, command) => {
|
||
|
|
const runner = context.deps.setup ?? (await import('../setup.js')).runKloSetup;
|
||
|
|
context.setExitCode(
|
||
|
|
await runner(
|
||
|
|
{
|
||
|
|
command: 'status',
|
||
|
|
projectDir: resolveCommandProjectDir(command),
|
||
|
|
json: options.json === true,
|
||
|
|
},
|
||
|
|
context.io,
|
||
|
|
),
|
||
|
|
);
|
||
|
|
});
|
||
|
|
}
|