Skip to content

Commit eda3c6d

Browse files
authored
Merge pull request #354 from db-ui/fix-path-resolve-gif-styles
fix: path resolving for generate-icon-fonts
2 parents 029401e + cc4b416 commit eda3c6d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/generate-icon-fonts/svg-to-font.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'node:url';
1+
import { fileURLToPath } from "node:url";
22
import path from "node:path";
33

44
import svgtofont from "svgtofont";
@@ -18,7 +18,14 @@ const svgToFont = async (
1818
lastSlashIndex = fileName.lastIndexOf("/");
1919
}
2020

21-
const generateIconFontsDir = fileName.slice(0, Math.max(0, lastSlashIndex));
21+
let generateIconFontsDir = fileName.slice(0, Math.max(0, lastSlashIndex));
22+
23+
if (generateIconFontsDir.endsWith("generate-icon-fonts")) {
24+
generateIconFontsDir = generateIconFontsDir.replace(
25+
"generate-icon-fonts",
26+
"",
27+
);
28+
}
2229

2330
try {
2431
return svgtofont({

0 commit comments

Comments
 (0)