Skip to content

Commit 323b544

Browse files
committed
refactor: use import.meta.dirname instead of fileURLToPath
1 parent 3df871a commit 323b544

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.changeset/salty-flowers-scream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-mcp-kit': patch
3+
---
4+
5+
refactor: use import.meta.dirname instead of fileURLToPath

packages/create-mcp-kit/src/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import { fileURLToPath } from 'url'
33
import { dirname, join, resolve } from 'path'
44
import * as clack from '@clack/prompts'
55
import pc from 'picocolors'
6-
import gradient from 'gradient-string'
7-
import { sleep, createProject, installDependencies, fileExists } from '@mcp-tool-kit/shared'
86

9-
const __filename = fileURLToPath(import.meta.url)
10-
const __dirname = dirname(__filename)
7+
const dirname = import.meta.dirname
118

129
clack.intro(
1310
gradient([
@@ -100,7 +97,7 @@ const group = await clack.group(
10097
},
10198
)
10299

103-
const templatePath = join(__dirname, '../template', `${group.type}-${group.language}`)
100+
const templatePath = join(dirname, '../template', `${group.type}-${group.language}`)
104101
const targetPath = resolve(process.cwd(), group.name as string)
105102

106103
if (!(await fileExists(templatePath))) {

0 commit comments

Comments
 (0)