Skip to content

Commit 424eb65

Browse files
committed
fix: use fileURLToPath instead of pathname
1 parent 21121d1 commit 424eb65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import * as fs from 'node:fs'
44
import * as path from 'node:path'
5-
5+
import { fileURLToPath } from 'node:url'
66
import { parseArgs } from 'node:util'
77
import { intro, outro, text, confirm, multiselect, select, isCancel, cancel } from '@clack/prompts'
88
import { red, green, cyan, bold, dim } from 'picocolors'
@@ -368,7 +368,7 @@ async function init() {
368368
const pkg = { name: result.packageName, version: '0.0.0' }
369369
fs.writeFileSync(path.resolve(root, 'package.json'), JSON.stringify(pkg, null, 2))
370370

371-
const templateRoot = new URL('./template', import.meta.url).pathname
371+
const templateRoot = fileURLToPath(new URL('./template', import.meta.url))
372372
const callbacks = []
373373
const render = function render(templateName) {
374374
const templateDir = path.resolve(templateRoot, templateName)

0 commit comments

Comments
 (0)