fix: fileExists lib error

This commit is contained in:
windingwind 2023-08-14 18:40:19 +08:00
parent c53376a71a
commit 5254db2b85
2 changed files with 2 additions and 2 deletions

View File

@ -192,7 +192,7 @@ async function getMDFileName(noteId: number, searchDir?: string) {
if (
(!searchDir || searchDir === syncStatus.path) &&
syncStatus.filename &&
(await fileExists(`${syncStatus.path}/${syncStatus.filename}`))
(await fileExists(PathUtils.join(syncStatus.path, syncStatus.filename)))
) {
return syncStatus.filename;
}

View File

@ -84,7 +84,7 @@ export async function fileExists(path: string): Promise<boolean> {
}
try {
// IOUtils.exists() will throw error if path is not valid
return await IOUtils.exists(path);
return await IOUtils.exists(formatPath(path));
} catch (e) {
ztoolkit.log(e);
return false;