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);