(program: Command)
| 41 | type InitCommandOptions = z.infer<typeof InitCommandOptions>; |
| 42 | |
| 43 | export function configureInitCommand(program: Command) { |
| 44 | return commonOptions( |
| 45 | program |
| 46 | .command("init") |
| 47 | .description("Initialize your existing project for development with Trigger.dev") |
| 48 | .argument("[path]", "The path to the project", ".") |
| 49 | .option( |
| 50 | "-p, --project-ref <project ref>", |
| 51 | "The project ref to use when initializing the project" |
| 52 | ) |
| 53 | .option( |
| 54 | "-t, --tag <package tag>", |
| 55 | "The version of the @trigger.dev/sdk package to install", |
| 56 | "beta" |
| 57 | ) |
| 58 | .option("--skip-package-install", "Skip installing the @trigger.dev/sdk package") |
| 59 | .option("--override-config", "Override the existing config file if it exists") |
| 60 | ).action(async (path, options) => { |
| 61 | await handleTelemetry(async () => { |
| 62 | await printStandloneInitialBanner(true); |
| 63 | await initCommand(path, options); |
| 64 | }); |
| 65 | }); |
| 66 | } |
| 67 | |
| 68 | export async function initCommand(dir: string, options: unknown) { |
| 69 | return await wrapCommandAction("initCommand", InitCommandOptions, options, async (opts) => { |
no test coverage detected
searching dependent graphs…