Skip to content

Commit 0b08bed

Browse files
committed
feat: register update and upgrade Commander subcommands
1 parent d25f14c commit 0b08bed

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,31 @@ program
704704
process.exit(0);
705705
});
706706

707+
// ── Update/Upgrade subcommand ───────────────────────────────────────────
708+
program
709+
.command('update')
710+
.description('Check for updates and install if available')
711+
.option('--check', 'Only check for updates without installing')
712+
.action(async (opts: { check?: boolean }) => {
713+
const { runUpdate } = await import('./commands/update.js');
714+
await runUpdate({
715+
currentVersion: packageJson.version,
716+
check: opts.check ?? false,
717+
});
718+
});
719+
720+
program
721+
.command('upgrade')
722+
.description('Check for updates and install if available')
723+
.option('--check', 'Only check for updates without installing')
724+
.action(async (opts: { check?: boolean }) => {
725+
const { runUpdate } = await import('./commands/update.js');
726+
await runUpdate({
727+
currentVersion: packageJson.version,
728+
check: opts.check ?? false,
729+
});
730+
});
731+
707732
async function runCLI(options: CLIOptions): Promise<void> {
708733
try {
709734
let config = await loadConfig(options.config);

0 commit comments

Comments
 (0)