From 8763dc32c46b1a025815c9807638046d0a45ab06 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 18 Apr 2023 17:25:37 +0200 Subject: [PATCH] refs #5553 Code syntax refactor --- back/methods/image/scrub.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/back/methods/image/scrub.js b/back/methods/image/scrub.js index 2eb9c4312..1cbe92625 100644 --- a/back/methods/image/scrub.js +++ b/back/methods/image/scrub.js @@ -90,15 +90,12 @@ module.exports = Self => { scrubDirCreated = true; } const dstFile = path.join(scrubSizeDir, image); - if (!dryRun) - await fs.rename(srcFile, dstFile); + if (!dryRun) await fs.rename(srcFile, dstFile); } else { - if (!dryRun) { - try { - await fs.unlink(srcFile); - } catch (err) { - console.error(err); - } + try { + if (!dryRun) await fs.unlink(srcFile); + } catch (err) { + console.error(err); } }