Skip to content

Commit

Permalink
fix(FS): Simplify even more
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardasN committed Jun 19, 2024
1 parent 3508e4f commit 2dc0312
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/core/src/system/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ export const fsRenameSync = (arg1: fs.PathLike | undefined, arg2: fs.PathLike) =
// File already exists with renamed name, skip renaming
if (fs.existsSync(arg2)) return;

if (fs.lstatSync(arg1).isDirectory()) {
fs.cpSync(arg1 as string, arg2 as string, { recursive: true });
fs.rmdirSync(arg1, { recursive: true });
} else if (fs.lstatSync(arg1).isFile()) {
fs.renameSync(arg1, arg2);
}
fs.renameSync(arg1, arg2);
};

export const fsStatSync = (arg1: fs.PathLike | undefined) => fs.statSync(arg1!);
Expand Down

0 comments on commit 2dc0312

Please sign in to comment.