|
|
@ -375,7 +375,7 @@ class Persistence { |
|
|
|
static async ensureDirectoryExistsAsync (dir, mode = DEFAULT_DIR_MODE) { |
|
|
|
static async ensureDirectoryExistsAsync (dir, mode = DEFAULT_DIR_MODE) { |
|
|
|
const parsedDir = path.parse(path.resolve(dir)) |
|
|
|
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
|
|
|
|
// 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 }) |
|
|
|
await storage.mkdirAsync(dir, { recursive: true, mode }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|