Skip to content

Commit 70a34de

Browse files
Fix(#136): 0.13.1版本win10默认存储区域无法找到文件 (#142)
1 parent b233e76 commit 70a34de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/workspace.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ export async function getGenericPathOptions(path: string, prefix?: string): Prom
9595
export async function toWorkspaceRelativePath(path: string): Promise<string> {
9696
const workspace = await getWorkspacePath()
9797

98+
const defaultDirRegex = /^(article[\\\/])/
9899
// 如果是默认工作区,移除"article/"前缀
99-
if (!workspace.isCustom && path.startsWith('article/')) {
100-
return path.replace('article/', '')
100+
if (!workspace.isCustom && defaultDirRegex.test(path)) {
101+
return path.replace(/article[\\\/]/g, '')
101102
}
102103

103104
// 如果是自定义工作区,移除工作区路径前缀

0 commit comments

Comments
 (0)