diff --git a/packages/nuxi/src/commands/init.ts b/packages/nuxi/src/commands/init.ts index 5ff91597..94cb899e 100644 --- a/packages/nuxi/src/commands/init.ts +++ b/packages/nuxi/src/commands/init.ts @@ -152,6 +152,11 @@ export default defineCommand({ options: packageManagerOptions, }) + if (!packageManagerOptions.includes(selectedPackageManager)) { + logger.error('Invalid package manager selected.') + process.exit(1) + } + // Install project dependencies // or skip installation based on the '--no-install' flag if (ctx.args.install === false) { @@ -183,7 +188,7 @@ export default defineCommand({ if (ctx.args.gitInit === undefined) { ctx.args.gitInit = await logger.prompt('Initialize git repository?', { type: 'confirm', - }) + }) === true } if (ctx.args.gitInit) { logger.info('Initializing git repository...\n') diff --git a/packages/nuxi/src/commands/module/add.ts b/packages/nuxi/src/commands/module/add.ts index 8891dfe3..7766790c 100644 --- a/packages/nuxi/src/commands/module/add.ts +++ b/packages/nuxi/src/commands/module/add.ts @@ -145,7 +145,7 @@ async function addModules(modules: ResolvedModule[], { skipInstall, skipConfig, }, ) - if (res === false) { + if (res !== true) { return } } @@ -268,6 +268,9 @@ async function resolveModule(moduleName: string, cwd: string): Promise