You've already forked simple-icons
mirror of
https://github.com/simple-icons/simple-icons.git
synced 2025-07-12 22:21:23 +02:00
Rename SDK function getIconDataPath
as getIconsDataPath
(#12215)
This commit is contained in:
committed by
GitHub
parent
4cafdbb614
commit
efd19c7068
@ -7,7 +7,7 @@
|
||||
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import {getDirnameFromImportMeta, getIconDataPath} from '../sdk.mjs';
|
||||
import {getDirnameFromImportMeta, getIconsDataPath} from '../sdk.mjs';
|
||||
|
||||
const __dirname = getDirnameFromImportMeta(import.meta.url);
|
||||
|
||||
@ -22,11 +22,10 @@ const __dirname = getDirnameFromImportMeta(import.meta.url);
|
||||
*/
|
||||
export const getJsonSchemaData = async (
|
||||
rootDirectory = path.resolve(__dirname, '..'),
|
||||
) => {
|
||||
const jsonSchemaPath = path.resolve(rootDirectory, '.jsonschema.json');
|
||||
const jsonSchemaString = await fs.readFile(jsonSchemaPath, 'utf8');
|
||||
return JSON.parse(jsonSchemaString);
|
||||
};
|
||||
) =>
|
||||
JSON.parse(
|
||||
await fs.readFile(path.resolve(rootDirectory, '.jsonschema.json'), 'utf8'),
|
||||
);
|
||||
|
||||
/**
|
||||
* Write icons data to _data/simple-icons.json.
|
||||
@ -40,7 +39,7 @@ export const writeIconsData = async (
|
||||
minify,
|
||||
) => {
|
||||
await fs.writeFile(
|
||||
getIconDataPath(rootDirectory),
|
||||
getIconsDataPath(rootDirectory),
|
||||
`${JSON.stringify(iconsData, null, minify ? 0 : 4)}\n`,
|
||||
'utf8',
|
||||
);
|
||||
@ -53,13 +52,15 @@ export const writeIconsData = async (
|
||||
*/
|
||||
export const getSpdxLicenseIds = async (
|
||||
rootDirectory = path.resolve(__dirname, '..'),
|
||||
) => {
|
||||
const getSpdxLicenseJson = path.resolve(
|
||||
rootDirectory,
|
||||
'node_modules',
|
||||
'spdx-license-ids',
|
||||
'index.json',
|
||||
) =>
|
||||
JSON.parse(
|
||||
await fs.readFile(
|
||||
path.resolve(
|
||||
rootDirectory,
|
||||
'node_modules',
|
||||
'spdx-license-ids',
|
||||
'index.json',
|
||||
),
|
||||
'utf8',
|
||||
),
|
||||
);
|
||||
const getSpdxLicenseString = await fs.readFile(getSpdxLicenseJson, 'utf8');
|
||||
return JSON.parse(getSpdxLicenseString);
|
||||
};
|
||||
|
Reference in New Issue
Block a user