You've already forked simple-icons
mirror of
https://github.com/simple-icons/simple-icons.git
synced 2025-10-30 23:07:47 +02:00
Use icons from CDN (#7950)
This commit is contained in:
22
scripts/build/strip-theme-link.js
Normal file
22
scripts/build/strip-theme-link.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @fileoverview
|
||||
* Simple Icons strip theme URL script.
|
||||
*/
|
||||
|
||||
import path from 'node:path';
|
||||
import { writeFile, readFile } from 'node:fs/promises';
|
||||
import { getDirnameFromImportMeta } from '../../sdk.mjs';
|
||||
|
||||
const __dirname = getDirnameFromImportMeta(import.meta.url);
|
||||
|
||||
const rootDir = path.resolve(__dirname, '..', '..');
|
||||
const readmeFile = path.resolve(rootDir, 'README.md');
|
||||
|
||||
const readme = await readFile(readmeFile, 'utf8');
|
||||
await writeFile(
|
||||
readmeFile,
|
||||
readme.replace(
|
||||
/https:\/\/cdn.simpleicons.org\/(.+)\/000\/fff/g,
|
||||
'https://raw.githubusercontent.com/simple-icons/simple-icons/develop/icons/$1.svg',
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user