From f14f58dafa0abae84e3328e2854ff82a3de5c03b Mon Sep 17 00:00:00 2001 From: Ivan Duplenskikh <115665590+ivanduplenskikh@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:21:42 +0100 Subject: [PATCH] Remove check on file --- node/task.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/node/task.ts b/node/task.ts index 1370db62d..0d2a7030c 100644 --- a/node/task.ts +++ b/node/task.ts @@ -1027,10 +1027,8 @@ export function mv(source: string, dest: string, options?: string, continueOnErr throw new Error(loc('LIB_DestinationNotExist', dest)); } - if (fs.existsSync(dest)) { - if (isNoClobber && fs.statSync(dest).isFile()) { - return; - } + if (fs.existsSync(dest) && isNoClobber) { + return; } fs.renameSync(source, dest);