Skip to content

Commit

Permalink
fix: copy file error in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Nov 17, 2024
1 parent 95394d7 commit 06a3bd1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/zhi-siyuan-picgo/src/lib/siyuanPicgoPostApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,10 @@ class SiyuanPicgoPostApi {
// 递归复制子文件夹
await this.copyFolder(sourcePath, destPath)
} else {
const destDir = path.dirname(destPath)
if (!fs.existsSync(destDir)) {
await fs.promises.mkdir(destDir, { recursive: true })
}
await fs.promises.copyFile(sourcePath, destPath)
}
}
Expand Down

0 comments on commit 06a3bd1

Please sign in to comment.