rename-overwrite
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -40,2 +40,10 @@ 'use strict' | ||
case 'ENOENT': | ||
try { | ||
await fs.promises.stat(oldPath) | ||
} catch (statErr) { | ||
// If the source file does not exist, we cannot possible rename it | ||
if (statErr.code === 'ENOENT') { | ||
throw statErr | ||
} | ||
} | ||
await fs.promises.mkdir(path.dirname(newPath), { recursive: true }) | ||
@@ -42,0 +50,0 @@ await renameOverwrite(oldPath, newPath) |
{ | ||
"name": "rename-overwrite", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Like `fs.rename` but overwrites existing file or directory", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5311
79