2023-03-02 08:51:56 +01:00
|
|
|
import path from 'path';
|
2024-02-01 22:38:21 +09:00
|
|
|
import { getCurrentDirPath, writeFileIfNotExists } from '../helpers.mjs';
|
2023-03-02 08:51:56 +01:00
|
|
|
|
|
|
|
|
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",
|
|
|
|
|
"tags": [
|
|
|
|
|
],
|
|
|
|
|
"categories": [
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
2024-02-01 22:38:21 +09:00
|
|
|
iconNames.forEach((iconName) => {
|
2023-03-02 08:51:56 +01:00
|
|
|
writeFileIfNotExists(iconSvgTemplate, `${iconName}.svg`, ICONS_DIR);
|
|
|
|
|
writeFileIfNotExists(iconJsonTemplate, `${iconName}.json`, ICONS_DIR);
|
|
|
|
|
});
|