Skip to content

Commit

Permalink
Merge pull request #771 from thundersdata-frontend/svgicon-issue
Browse files Browse the repository at this point in the history
fix: 修复另一处 glob 使用的报错
  • Loading branch information
chj-damon authored Nov 21, 2023
2 parents 4d2738f + f77a440 commit a57a5da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/smart-owls-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@td-design/svgicon-cli': patch
---

修复另一处 glob 使用的报错
4 changes: 2 additions & 2 deletions packages/svgicon-cli/src/libs/generateComponent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import colors from 'colors';
import fs from 'fs';
import glob from 'glob';
import { globSync } from 'glob';
import { camelCase, upperFirst } from 'lodash';
import mkdirp from 'mkdirp';
import path from 'path';
Expand Down Expand Up @@ -35,7 +35,7 @@ export const generateComponent = (localSvg: ILocalSvg[], config: Config) => {
let cases = '';

mkdirp.sync(saveDir);
glob.sync(path.join(saveDir, '*')).forEach(file => fs.unlinkSync(file));
globSync(path.join(saveDir, '*')).forEach(file => fs.unlinkSync(file));
svgComponents.add('GProps');

copyTemplate(`helper${jsExtension}`, path.join(saveDir, `helper${jsExtension}`));
Expand Down

0 comments on commit a57a5da

Please sign in to comment.