From 1b7f72d6d7c1d231c6f4b1ec67a707f5bb60643e Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Wed, 7 Aug 2024 20:50:10 +0100 Subject: [PATCH] fix: log success per codemod (#5) --- src/main.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 22288af..88a325f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -178,6 +178,10 @@ async function fixFile( } }); + cl.log.success(dedent` + Applying codemod ${pc.cyan(replacement.moduleName)} to ${scanResult.path} + `); + newContent = transformResult; } catch (err) { cl.log.error(dedent` @@ -189,10 +193,6 @@ async function fixFile( } if (scanResult.contents !== newContent) { - cl.log.success(dedent` - Writing file ${scanResult.path} with codemod changes. - `); - await writeFile(scanResult.path, newContent, 'utf8'); } }