diff --git a/src/main/server/file.ts b/src/main/server/file.ts index fab8d3e3..0a292aca 100644 --- a/src/main/server/file.ts +++ b/src/main/server/file.ts @@ -82,6 +82,11 @@ function withRepo (repo = 'main', callback: (repoPath: string, ...targetPath: } return callback(repoPath, ...target.map(x => { + // fix path + if (!x.startsWith('/')) { + x = '/' + x + } + const targetPath = isRootRepo ? x.replace(/^\//, repoPath) // replace first / to repoPath for case of `\\127.0.0.1/test/a.md` : path.join(repoPath, x)