@nuxt/cli
Version:
Nuxt CLI
37 lines (36 loc) • 1 kB
JavaScript
import { h as defineCommand, l as rootDirArgs } from "./_shared-B9W-9akb.mjs";
import { D as ActionableError } from "./startup-clock-SyYej6uN.mjs";
import { i as resolveRootDir } from "./paths-BipyohVL.mjs";
import { x } from "tinyexec";
// src/commands/devtools.ts
var devtools_default = defineCommand({
meta: {
name: "devtools",
description: "Enable or disable devtools in a Nuxt project"
},
args: {
command: {
type: "positional",
description: "Command to run",
valueHint: "enable|disable"
},
...rootDirArgs
},
async run(ctx) {
const cwd = resolveRootDir(ctx.args);
const command = ctx.args.command;
if (command !== "enable" && command !== "disable") throw new ActionableError(`Unknown devtools command \`${command}\`. Expected \`enable\` or \`disable\`.`);
await x("npx", [
"--yes",
"@nuxt/devtools-wizard@latest",
command
], {
throwOnError: true,
nodeOptions: {
stdio: "inherit",
cwd
}
});
}
});
export { devtools_default as default };