mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-08-29 09:28:23 +02:00
* chore: upgrade eslint to v9 latest with compatible lint deps Agent-Logs-Url: https://github.com/lucide-icons/lucide/sessions/f7c1f1b5-d213-4afa-91a8-b799a16397ec * Fix eslint config * Fix a lot of eslint errors * Fix eslint * Fix eslint errors * Fix eslint errors * Fix types * Fix eslint warning * Format code * Add eslint 10 * Remove unused vars * Update pnpm * Update deps --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
34 lines
915 B
TypeScript
34 lines
915 B
TypeScript
import { lstatSync } from 'fs';
|
|
import { readdir, readFile, writeFile } from 'fs/promises';
|
|
import path from 'path';
|
|
import { getCurrentDirPath } from '@lucide/helpers';
|
|
import { getJSBanner } from './license.mts';
|
|
|
|
const currentDir = getCurrentDirPath(import.meta.url);
|
|
const targetDirectory = path.join(currentDir, '../dist');
|
|
|
|
const jsBanner = getJSBanner();
|
|
|
|
const files = await readdir(targetDirectory, {
|
|
recursive: true,
|
|
encoding: 'utf-8',
|
|
});
|
|
|
|
|
|
for (const file of files) {
|
|
const filepath = path.join(targetDirectory, file);
|
|
const filestat = lstatSync(filepath);
|
|
|
|
|
|
if (filestat.isFile() === false || filestat.isDirectory()) continue;
|
|
|
|
|
|
const contents = (await readFile(filepath, { encoding: 'utf-8' })) as unknown as string;
|
|
const ext = path.extname(filepath);
|
|
|
|
if (/\.(js|mjs|cjs|ts)/.test(ext)) {
|
|
|
|
await writeFile(filepath, jsBanner + contents, { encoding: 'utf-8' });
|
|
}
|
|
}
|