mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-15 14:08:49 +00:00
* cleanup scripts * Move helpers to package * Fixes scripts * Fix scripts * Formatting * Fix helpers import paths * Remove lucide-figma * Rename helpers package * Fix build * formatting * Adjust main build-icons file * Add export casing * Adds `exportModuleNameCasing` fro lab project * format files * Bump package version @lucide/build-icons * Revert changes in icons * Revert changes in PR yml * Fix lint issues * Fix site build * fix lint errors * Attempt fix linting * Fix lint errors
38 lines
811 B
JavaScript
38 lines
811 B
JavaScript
import path from 'path';
|
|
import { getCurrentDirPath, writeFileIfNotExists } from '@lucide/helpers';
|
|
|
|
const currentDir = getCurrentDirPath(import.meta.url);
|
|
const ICONS_DIR = path.resolve(currentDir, '../../icons');
|
|
|
|
const iconNames = process.argv.slice(2);
|
|
|
|
const iconSvgTemplate = `<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
width="24"
|
|
height="24"
|
|
viewBox="0 0 24 24"
|
|
fill="none"
|
|
stroke="currentColor"
|
|
stroke-width="2"
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
>
|
|
</svg>
|
|
`;
|
|
|
|
const iconJsonTemplate = `{
|
|
"$schema": "../icon.schema.json",
|
|
"contributors": [
|
|
],
|
|
"tags": [
|
|
],
|
|
"categories": [
|
|
]
|
|
}
|
|
`;
|
|
|
|
iconNames.forEach((iconName) => {
|
|
writeFileIfNotExists(iconSvgTemplate, `${iconName}.svg`, ICONS_DIR);
|
|
writeFileIfNotExists(iconJsonTemplate, `${iconName}.json`, ICONS_DIR);
|
|
});
|