UNPKG

nuxi

Version:
46 lines (45 loc) 1.24 kB
import { t as defineCommand } from "./dist-B03QHgrC.mjs"; import { n as colors } from "./consola.DXBYu-KD-qSGefJ79.mjs"; import "./utils-MaFlCoS1.mjs"; import { a as legacyRootDirArgs, t as cwdArgs } from "./_shared-D6pJgr6t.mjs"; import { n as logger } from "./logger-CtlB9piy.mjs"; import { c as resolve } from "./pathe.M-eThtNZ-BfnU2wdd.mjs"; import { t as V } from "./main-BD07ngkv.mjs"; import process from "node:process"; //#region src/commands/devtools.ts var devtools_default = defineCommand({ meta: { name: "devtools", description: "Enable or disable devtools in a Nuxt project" }, args: { ...cwdArgs, command: { type: "positional", description: "Command to run", valueHint: "enable|disable" }, ...legacyRootDirArgs }, async run(ctx) { const cwd = resolve(ctx.args.cwd || ctx.args.rootDir); const command = ctx.args.command; if (!command || !["enable", "disable"].includes(command)) { logger.error(`Unknown command ${colors.cyan(command || "")}.`); process.exit(1); } await V("npx", [ "@nuxt/devtools-wizard@latest", command, cwd ], { throwOnError: true, nodeOptions: { stdio: "inherit", cwd } }); } }); //#endregion export { devtools_default as default };