UNPKG

@lunora/cli

Version:

The Lunora CLI: init, dev, deploy, codegen, run, reset, and migrate commands

45 lines (42 loc) 1.54 kB
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs'; import { r as runAddCommand, b as runRegistryViewCommand, a as runBuildIndexCommand } from '../packem_shared/commands-D5Yxt9VY.mjs'; const execute = defineHandler(({ argument, cwd, logger, options }) => { const subcommand = argument[0]; const names = argument.slice(1); if (subcommand === "add") { return runAddCommand({ allowUnsafeSource: options.allowUnsafeSource === true, cwd, diff: options.diff === true, dryRun: options.dryRun === true, from: options.from, json: options.json === true, logger, names, overwrite: options.overwrite === true, ref: options.ref, source: options.source, yes: options.yes === true }); } if (subcommand === "list") { return runAddCommand({ cwd, from: options.from, json: options.json === true, list: true, logger, names: [], ref: options.ref, source: options.source }); } if (subcommand === "view") { return runRegistryViewCommand({ allowUnsafeSource: options.allowUnsafeSource === true, cwd, from: options.from, logger, names, ref: options.ref, source: options.source }); } if (subcommand === "build") { return runBuildIndexCommand({ check: options.check === true, from: options.from, logger, out: options.out }); } logger.error("registry: unknown subcommand. Usage: lunora registry <add|list|view|build> [names…]"); return { code: 1 }; }); export { execute };