Skip to content

Commit 17a8425

Browse files
committed
Correct bugs in only_include_used_icons script
1 parent fd40a77 commit 17a8425

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/bin/only_include_used_icons.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ import type { Equals } from "tsafe";
6666
return true;
6767
}
6868
})
69-
).filter(filePath =>
70-
["tsx", "jsx", "js", "ts", "html", "htm"].find(
71-
ext => filePath.endsWith(`.${ext}`) !== undefined
72-
)
69+
).filter(
70+
filePath =>
71+
["tsx", "jsx", "js", "ts", "html", "htm"].find(ext =>
72+
filePath.endsWith(`.${ext}`)
73+
) !== undefined
7374
);
7475

7576
const prefixes = { "prefixDsfr": "fr-icon-", "prefixRemixIcon": "ri-" } as const;
@@ -152,7 +153,7 @@ import type { Equals } from "tsafe";
152153
].forEach(async dsfrDistDirPath => {
153154
const remixiconDirPath = pathJoin(dsfrDistDirPath, "icons", "remixicon");
154155

155-
if (!fs.existsSync(dsfrDistDirPath)) {
156+
if (!fs.existsSync(remixiconDirPath)) {
156157
fs.mkdirSync(remixiconDirPath);
157158
}
158159

@@ -166,7 +167,7 @@ import type { Equals } from "tsafe";
166167
)
167168
);
168169

169-
["icons.css", "icon.min.css"].forEach(cssFileBasename =>
170+
["icons.css", "icons.min.css"].forEach(cssFileBasename =>
170171
writeFile(
171172
pathJoin(dsfrDistDirPath, "utility", "icons", cssFileBasename),
172173
rawIconCssCodeBuffer

0 commit comments

Comments
 (0)