Skip to content

Commit

Permalink
Merge pull request #236 from oceanbase/dengfuping-dev
Browse files Browse the repository at this point in the history
fix(codemod): path => targetPath to avoid duplicate name when prettier
  • Loading branch information
dengfuping authored Oct 29, 2023
2 parents 7230610 + c06bd88 commit 3ca213f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/codemod/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3ca213f

Please sign in to comment.