From be1c4f77fac19ffcd7dfc0b666bfb323e4fc5d22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=9D=B0?= Date: Tue, 21 Nov 2023 15:33:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dmkdirp=20API=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/great-mirrors-crash.md | 5 +++++ packages/svgicon-cli/src/libs/generateComponent.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/great-mirrors-crash.md diff --git a/.changeset/great-mirrors-crash.md b/.changeset/great-mirrors-crash.md new file mode 100644 index 0000000000..cd6a815dc9 --- /dev/null +++ b/.changeset/great-mirrors-crash.md @@ -0,0 +1,5 @@ +--- +'@td-design/svgicon-cli': patch +--- + +修复mkdirp API 使用错误 diff --git a/packages/svgicon-cli/src/libs/generateComponent.ts b/packages/svgicon-cli/src/libs/generateComponent.ts index bbac5e289d..2815e0d9e6 100644 --- a/packages/svgicon-cli/src/libs/generateComponent.ts +++ b/packages/svgicon-cli/src/libs/generateComponent.ts @@ -2,7 +2,7 @@ import colors from 'colors'; import fs from 'fs'; import { globSync } from 'glob'; import { camelCase, upperFirst } from 'lodash'; -import mkdirp from 'mkdirp'; +import { mkdirpSync } from 'mkdirp'; import path from 'path'; import { ILocalSvg } from '../libs/parseLocalSvg'; @@ -34,7 +34,7 @@ export const generateComponent = (localSvg: ILocalSvg[], config: Config) => { const jsExtension = '.ts'; let cases = ''; - mkdirp.sync(saveDir); + mkdirpSync(saveDir); globSync(path.join(saveDir, '*')).forEach(file => fs.unlinkSync(file)); svgComponents.add('GProps');