Skip to content

Commit

Permalink
Merge pull request #354 from db-ui/fix-path-resolve-gif-styles
Browse files Browse the repository at this point in the history
fix: path resolving for generate-icon-fonts
  • Loading branch information
nmerget authored Nov 29, 2024
2 parents 029401e + cc4b416 commit eda3c6d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/generate-icon-fonts/svg-to-font.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fileURLToPath } from 'node:url';
import { fileURLToPath } from "node:url";
import path from "node:path";

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

const generateIconFontsDir = fileName.slice(0, Math.max(0, lastSlashIndex));
let generateIconFontsDir = fileName.slice(0, Math.max(0, lastSlashIndex));

if (generateIconFontsDir.endsWith("generate-icon-fonts")) {
generateIconFontsDir = generateIconFontsDir.replace(
"generate-icon-fonts",
"",
);
}

try {
return svgtofont({
Expand Down

0 comments on commit eda3c6d

Please sign in to comment.