update moveFile API
This commit is contained in:
parent
e39cb09245
commit
8e16d18014
|
@ -255,7 +255,7 @@ export async function moveFile(
|
|||
// check if destination folder exists
|
||||
const destinationFolder = path.dirname(destinationPath);
|
||||
if (!existsSync(destinationFolder)) {
|
||||
throw new Error('Destination folder does not exist');
|
||||
await fs.mkdir(destinationFolder, { recursive: true });
|
||||
}
|
||||
await fs.rename(sourcePath, destinationPath);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue