Skip to content

Commit

Permalink
fix(init): handle init in current directory (when using pnpm)
Browse files Browse the repository at this point in the history
Fixes #213
  • Loading branch information
jits committed Nov 1, 2023
1 parent 751bf93 commit e476a97
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ export default defineCommand({
})

// Get relative project path
const relativeProjectPath = relative(process.cwd(), template.dir)
let relativeProjectPath = relative(process.cwd(), template.dir)
if (relativeProjectPath === '') {
relativeProjectPath = '.';
}

// Write .nuxtrc with `shamefully-hoist=true` for pnpm
// Write .npmrc with `shamefully-hoist=true` for pnpm
if (selectedPackageManager === 'pnpm') {
await writeFile(`${relativeProjectPath}/.npmrc`, 'shamefully-hoist=true')
}
Expand Down

0 comments on commit e476a97

Please sign in to comment.