diff --git a/scripts/generate.code-workspace.ts b/scripts/generate.code-workspace.ts index 0b25d39..6256bc1 100644 --- a/scripts/generate.code-workspace.ts +++ b/scripts/generate.code-workspace.ts @@ -152,8 +152,7 @@ function generateCodeWorkspace(filename: string = defCodeWorkspaceFilename) { const postfix = ".code-workspace"; const fullName = `${filename}${postfix}`; - // TODO: 待优化 这里的路径读取还是不够智能 有写死的情况 - const codeWorkspacePath = join(__dirname, "..", fullName); + const codeWorkspacePath = join(process.cwd(), fullName); fs.writeFileSync(codeWorkspacePath, JSON.stringify(codeWorkspaceContent, null, 2)); }