fix(fs): Fixed copy and copySync functions to ensure they always overwrite files.
This commit is contained in:
4
ts/fs.ts
4
ts/fs.ts
@@ -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});
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user