Use ensureDir instead of mkdir to fix 698

This commit updates the mkdir for creating the download location to
ensureDir, which is an alias for mkdirs and mkdirp, meaning they will
create the entire path of the directory if it does not exist.

https://github.com/jprichardson/node-fs-extra/blob/master/docs/ensureDir.md
This commit is contained in:
jmt-gh 2022-06-06 08:12:58 -07:00
parent ac00f3ebe7
commit 35f29ca22b

View File

@ -73,9 +73,10 @@ class AbMergeManager {
try {
await fs.mkdir(download.dirpath)
await fs.ensureDir(download.dirpath)
} catch (error) {
Logger.error(`[AbMergeManager] Failed to make directory ${download.dirpath}`)
Logger.debug(`[AbMergeManager] Make directory error: ${error}`)
var downloadJson = download.toJSON()
this.clientEmitter(user.id, 'abmerge_failed', downloadJson)
return