From 5481a2c4c42c3f24952905b7edabb1d7107b5677 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 19 Dec 2024 20:17:01 +0000 Subject: [PATCH] fix(module): pass resolved `cwd` to `addDependency` --- src/commands/module/add.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/module/add.ts b/src/commands/module/add.ts index 5a0b36881..5e0ef4d3e 100644 --- a/src/commands/module/add.ts +++ b/src/commands/module/add.ts @@ -58,7 +58,7 @@ export default defineCommand({ }, async setup(ctx) { const cwd = resolve(ctx.args.cwd) - const modules = ctx.args._ + const modules = ctx.args._.map(e => e.trim()).filter(Boolean) const projectPkg = await getProjectPackage(cwd) if (!projectPkg.dependencies?.nuxt && !projectPkg.devDependencies?.nuxt) { @@ -80,7 +80,7 @@ export default defineCommand({ consola.info(`Resolved ${r.map(x => x.pkgName).join(', ')}, adding module(s)...`) - await addModule(r, ctx.args, projectPkg) + await addModule(r, { ...ctx.args, cwd }, projectPkg) // update the types for new module const args = Object.entries(ctx.args).filter(([k]) => k in cwdArgs || k in logLevelArgs).map(([k, v]) => `--${k}=${v}`)