fix(fs): Fixed copy and copySync functions to ensure they always overwrite files.

This commit is contained in:
2025-01-29 18:14:02 +01:00
parent 04a25221a5
commit 2d1ac0bd50
3 changed files with 9 additions and 3 deletions

View File

@@ -75,14 +75,14 @@ export const isFile = (pathArg): boolean => {
* copies a file or directory from A to B on the local disk
*/
export const copy = async (fromArg: string, toArg: string): Promise<void> => {
return await plugins.fsExtra.copy(fromArg, toArg, {});
return await plugins.fsExtra.copy(fromArg, toArg, {overwrite: true});
};
/**
* copies a file or directory SYNCHRONOUSLY from A to B on the local disk
*/
export const copySync = (fromArg: string, toArg: string): void => {
return plugins.fsExtra.copySync(fromArg, toArg);
return plugins.fsExtra.copySync(fromArg, toArg, {overwrite: true});
};
/**