Skip to content

Commit

Permalink
Merge pull request #633 from terwer/dev
Browse files Browse the repository at this point in the history
fix: copy file error in some cases
  • Loading branch information
terwer authored Nov 17, 2024
2 parents 95394d7 + 06a3bd1 commit bf9d50e
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 bf9d50e

Please sign in to comment.