Skip to content

Commit

Permalink
fix more properly #48 after reading path.parse documentation more tho…
Browse files Browse the repository at this point in the history
…roughly
  • Loading branch information
Timothée Rebours committed Dec 13, 2023
1 parent 03217ce commit afe1831
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/persistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
}
Expand Down

0 comments on commit afe1831

Please sign in to comment.