devtools
devtools copied to clipboard
fix: selecting 'n' when running `devtools enable|disable` throws error
đ The bug
Created a new v3 nuxt app. devtools is listed as enabled by default in the generated config file:
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true }
})
Upon trying to disable dev tools via npx nuxi@latest devtools disable it prompted me to install the devtools-wizard:
⯠npx nuxi@latest devtools disable
Nuxi 3.6.5
Need to install the following packages:
@nuxt/[email protected]
Ok to proceed? (y)
If i enter n (or anything not y), it throws an error.
Ok to proceed? (y) n
npm ERR! canceled
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/gilzow/.npm/_logs/2023-07-26T20_47_43_752Z-debug-0.log
ERROR Command failed with exit code 1: npx @nuxt/devtools-wizard@latest disable /Users/gilzow/projects/delete/nuxt-test/mynuxtapp 3:48:43 PM
at makeError (/Users/gilzow/.npm/_npx/b95349761371180e/node_modules/nuxi/dist/shared/nuxi.e25041ef.mjs:619:11)
at handlePromise (/Users/gilzow/.npm/_npx/b95349761371180e/node_modules/nuxi/dist/shared/nuxi.e25041ef.mjs:1108:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.invoke (/Users/gilzow/.npm/_npx/b95349761371180e/node_modules/nuxi/dist/chunks/devtools.mjs:40:5)
at async _main (/Users/gilzow/.npm/_npx/b95349761371180e/node_modules/nuxi/dist/cli.mjs:49:20)
Same thing happens if I do npx nuxi@latest devtools enable and select anything that isn't y at the prompt.
đ ī¸ To reproduce
n/a
đ Expected behavior
if the user selects n, the cli should simply exit
âšī¸ Additional context
No response