Skip to content

Commit

Permalink
fix(module): pass resolved cwd to addDependency
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 19, 2024
1 parent 9fca1dd commit 5481a2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands/module/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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}`)
Expand Down

0 comments on commit 5481a2c

Please sign in to comment.