Files
lucide/scripts/optimizeStagedSvgs.mjs
Karsa 1479a9dbd8 Fixes pre-commit git hook to ensure the optimisation of staged icons (#958)
* testing

* Fixes pre-commit hook

* Removing checkIcons from pre commit hook because it might result in false positives and negatives on an unclean local repository

* Added checkIcons Github action

---------

Co-authored-by: Karsa <karsa@karsa.org>
2023-02-28 17:24:17 +01:00

12 lines
346 B
JavaScript

import fs from 'fs';
import processSvg from './render/processSvg.mjs';
const svgFiles = process.argv.slice(2);
svgFiles.forEach(async (svgFile) => {
console.log('Optimizing staged SVG file:', svgFile)
const content = fs.readFileSync(svgFile);
const svg = await processSvg(content, svgFile);
fs.writeFileSync(svgFile, svg, 'utf-8');
});