From c06bd88eb3b01773acb3a85365998f1420c652c1 Mon Sep 17 00:00:00 2001 From: dengfuping Date: Sun, 29 Oct 2023 20:33:01 +0800 Subject: [PATCH] fix(codemod): path => targetPath to avoid duplicate name when prettier --- packages/codemod/bin/cli.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/codemod/bin/cli.js b/packages/codemod/bin/cli.js index 642e771a1..727525690 100644 --- a/packages/codemod/bin/cli.js +++ b/packages/codemod/bin/cli.js @@ -291,9 +291,9 @@ async function bootstrap() { console.log('[Prettier] format files running...'); try { const isDir = isDirectory.sync(dir); - const path = isDir ? path.join(dir, '**/*.{js,jsx,ts,tsx,d.ts}') : dir; + const targetPath = isDir ? path.join(dir, '**/*.{js,jsx,ts,tsx,d.ts}') : dir; const npxCommand = commandExistsSync('tnpx') ? 'tnpx' : 'npx'; - await execa(npxCommand, ['prettier', '--write', path], { stdio: 'inherit' }); + await execa(npxCommand, ['prettier', '--write', targetPath], { stdio: 'inherit' }); console.log('\n[Prettier] format files completed!\n'); } catch (err) { console.log('\n[Prettier] format files failed, please format it by yourself.\n', err);