mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 21:27:42 +01:00
fix(scripts): Add extra const for path mapping
This commit is contained in:
@@ -43,12 +43,13 @@ const getImageTagsByFiles = (files, getBaseUrl, width) =>
|
||||
return `<img title="${file}" alt="${file}" ${widthAttr} src="${url}/${base64}.svg"/>`;
|
||||
});
|
||||
|
||||
const svgFiles = await readSvgDirectory(ICONS_DIR).map((file) => `icons/${file}`);
|
||||
const svgFiles = await readSvgDirectory(ICONS_DIR)
|
||||
const svgFilePaths = svgFiles.map((file) => `icons/${file}`);
|
||||
|
||||
const iconsFilteredByName = (search) => svgFiles.filter((file) => file.includes(search));
|
||||
const iconsFilteredByName = (search) => svgFilePaths.filter((file) => file.includes(search));
|
||||
|
||||
const cohesionRandomImageTags = getImageTagsByFiles(
|
||||
shuffleArray(svgFiles).slice(0, changedFiles.length),
|
||||
shuffleArray(svgFilePaths).slice(0, changedFiles.length),
|
||||
() => `${BASE_URL}/stroke-width/2`,
|
||||
).join('');
|
||||
|
||||
|
||||
@@ -12,5 +12,8 @@ import path from 'path';
|
||||
export const readSvgDirectory = async (directory, fileExtension = '.svg') => {
|
||||
const directoryContents = await fs.readdir(directory);
|
||||
|
||||
console.log(directoryContents);
|
||||
|
||||
|
||||
return directoryContents.filter((file) => path.extname(file) === fileExtension);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user