UNPKG

@tsed/cli

Version:
42 lines (41 loc) 1.29 kB
import { __decorate } from "tslib"; import { CliFs, Command, inject, normalizePath, ProjectPackageJson } from "@tsed/cli-core"; import { CliRunScript } from "../../services/CliRunScript.js"; let RunCmd = class RunCmd { constructor() { this.fs = inject(CliFs); this.projectPackageJson = inject(ProjectPackageJson); this.runScript = inject(CliRunScript); } async $exec(ctx) { const cmd = "node"; const args = ["--import", "@swc-node/register/esm-register"]; const path = normalizePath("src/bin/index.ts"); await this.runScript.run(cmd, [...args, path, ctx.command, ...ctx.rawArgs], { env: process.env }); return []; } }; RunCmd = __decorate([ Command({ name: "run", description: "Run a project level command", args: { command: { description: "The project command", type: String, required: true } }, options: { "-p, --production": { type: Boolean, defaultValue: false, description: "Set production profile to NODE_ENV" } }, allowUnknownOption: true }) ], RunCmd); export { RunCmd };