Skip to content

Commit

Permalink
🎈 perf: 优化了生成 生成 vscode.code-workspace 文件 的函数,现在可以智能的识别出当前工作路径了。
Browse files Browse the repository at this point in the history
  • Loading branch information
ruan-cat committed Nov 12, 2024
1 parent fb398c5 commit 57a6f34
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/generate.code-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ function generateCodeWorkspace(filename: string = defCodeWorkspaceFilename) {
const postfix = <const>".code-workspace";
const fullName = <const>`${filename}${postfix}`;

// TODO: 待优化 这里的路径读取还是不够智能 有写死的情况
const codeWorkspacePath = join(__dirname, "..", fullName);
const codeWorkspacePath = join(process.cwd(), fullName);
fs.writeFileSync(codeWorkspacePath, JSON.stringify(codeWorkspaceContent, null, 2));
}

Expand Down

0 comments on commit 57a6f34

Please sign in to comment.