From 7baba5a75d211571359503808986fb5e9c557436 Mon Sep 17 00:00:00 2001 From: Stephen Lacy Date: Tue, 6 May 2025 12:57:30 -0700 Subject: [PATCH] chore: move cmd to separate export --- src/cmd.ts | 33 +++++++++++++++++++++++++++++++++ src/index.ts | 37 ++----------------------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/cmd.ts b/src/cmd.ts index df4700a..cb72fcd 100644 --- a/src/cmd.ts +++ b/src/cmd.ts @@ -2,7 +2,20 @@ import { Command, EnumType } from '@cliffy/command' import { ulid } from './lib/ulid.ts' import { Config } from './lib/config.ts' import { logger, LogLevel } from './lib/logger.ts' +import { VERSION } from './version.ts' +import { debug } from './commands/debug/index.ts' +import { engine } from './commands/engine/index.ts' +import { init } from './commands/init.ts' +import { uat } from './commands/uat.ts' +import { ubt } from './commands/ubt.ts' +import { buildgraph } from './commands/buildgraph/index.ts' +import { workflow } from './commands/workflow/index.ts' +import { script } from './commands/script.ts' +import { uasset } from './commands/uasset/index.ts' +import { auth } from './commands/auth.ts' +import { project } from './commands/project/index.ts' +import { listTargets } from './commands/list-targets.ts' const LogLevelType = new EnumType(LogLevel) export const cmd = new Command() @@ -30,3 +43,23 @@ export const cmd = new Command() // We load the config here so that the singleton should be instantiated before any command is run await Config.create({ path: options.configPath }) }) + +export const cli = cmd + .name('runreal') + .version(VERSION) + .description('the Unreal Engine runner') + .action(function () { + this.showHelp() + }) + .command('init', init) + .command('debug', debug) + .command('list-targets', listTargets) + .command('engine', engine) + .command('uat', uat) + .command('ubt', ubt) + .command('buildgraph', buildgraph) + .command('workflow', workflow) + .command('script', script) + .command('auth', auth) + .command('uasset', uasset) + .command('project', project) diff --git a/src/index.ts b/src/index.ts index 778b4dc..41ed8e9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,36 +1,3 @@ -import { VERSION } from './version.ts' +import { cli } from './cmd.ts' -import { debug } from './commands/debug/index.ts' -import { engine } from './commands/engine/index.ts' -import { init } from './commands/init.ts' -import { uat } from './commands/uat.ts' -import { ubt } from './commands/ubt.ts' -import { buildgraph } from './commands/buildgraph/index.ts' -import { workflow } from './commands/workflow/index.ts' -import { cmd } from './cmd.ts' -import { script } from './commands/script.ts' -import { uasset } from './commands/uasset/index.ts' -import { auth } from './commands/auth.ts' -import { project } from './commands/project/index.ts' -import { listTargets } from './commands/list-targets.ts' - -await cmd - .name('runreal') - .version(VERSION) - .description('the Unreal Engine runner') - .action(function () { - this.showHelp() - }) - .command('init', init) - .command('debug', debug) - .command('list-targets', listTargets) - .command('engine', engine) - .command('uat', uat) - .command('ubt', ubt) - .command('buildgraph', buildgraph) - .command('workflow', workflow) - .command('script', script) - .command('auth', auth) - .command('uasset', uasset) - .command('project', project) - .parse(Deno.args) +await cli.parse(Deno.args)