From afe183148516f7c72e0dd6611503852b879dc9c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Rebours?= Date: Wed, 13 Dec 2023 15:42:23 +0100 Subject: [PATCH] fix more properly #48 after reading path.parse documentation more thoroughly --- lib/persistence.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/persistence.js b/lib/persistence.js index f10ec57..ba359a5 100755 --- a/lib/persistence.js +++ b/lib/persistence.js @@ -375,7 +375,7 @@ class Persistence { static async ensureDirectoryExistsAsync (dir, mode = DEFAULT_DIR_MODE) { const parsedDir = path.parse(path.resolve(dir)) // this is because on Windows mkdir throws a permission error when called on the root directory of a volume - if (process.platform !== 'win32' || parsedDir.dir !== parsedDir.root) { + if (process.platform !== 'win32' || parsedDir.dir !== parsedDir.root || parsedDir.base !== '') { await storage.mkdirAsync(dir, { recursive: true, mode }) } }