mirror of
https://github.com/Mibew/simple-icons.git
synced 2025-01-31 22:34:45 +03:00
Drop del-cli dependency (#10652)
This commit is contained in:
parent
33f7d01c38
commit
1350a52726
@ -86,7 +86,6 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@inquirer/prompts": "4.3.0",
|
"@inquirer/prompts": "4.3.0",
|
||||||
"chalk": "5.3.0",
|
"chalk": "5.3.0",
|
||||||
"del-cli": "5.1.0",
|
|
||||||
"editorconfig-checker": "5.1.5",
|
"editorconfig-checker": "5.1.5",
|
||||||
"esbuild": "0.19.4",
|
"esbuild": "0.19.4",
|
||||||
"fake-diff": "1.0.0",
|
"fake-diff": "1.0.0",
|
||||||
@ -108,7 +107,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node scripts/build/package.js",
|
"build": "node scripts/build/package.js",
|
||||||
"clean": "del-cli index.js index.mjs index.d.ts sdk.js",
|
"clean": "node scripts/build/clean.js",
|
||||||
"format": "prettier --cache --write .",
|
"format": "prettier --cache --write .",
|
||||||
"lint": "npm run ourlint && npm run jslint && npm run jsonlint && npm run svglint && npm run wslint",
|
"lint": "npm run ourlint && npm run jslint && npm run jsonlint && npm run svglint && npm run wslint",
|
||||||
"ourlint": "node scripts/lint/ourlint.js",
|
"ourlint": "node scripts/lint/ourlint.js",
|
||||||
|
29
scripts/build/clean.js
Normal file
29
scripts/build/clean.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/**
|
||||||
|
* @fileoverview
|
||||||
|
* Clean files built by the build process.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import fs from 'node:fs';
|
||||||
|
import path from 'node:path';
|
||||||
|
import { getDirnameFromImportMeta } from '../../sdk.mjs';
|
||||||
|
|
||||||
|
const __dirname = getDirnameFromImportMeta(import.meta.url);
|
||||||
|
const rootDirectory = path.resolve(__dirname, '..', '..');
|
||||||
|
const files = ['index.js', 'index.mjs', 'index.d.ts', 'sdk.js'];
|
||||||
|
|
||||||
|
const fileExists = (fpath) =>
|
||||||
|
new Promise((r) => fs.access(fpath, fs.constants.F_OK, (e) => r(!e)));
|
||||||
|
|
||||||
|
Promise.all(
|
||||||
|
files.map(async (file) => {
|
||||||
|
const filepath = path.join(rootDirectory, file);
|
||||||
|
if (!(await fileExists(filepath))) {
|
||||||
|
console.error(`File ${file} does not exist, skipping...`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return fs.promises.unlink(filepath);
|
||||||
|
}),
|
||||||
|
).catch((error) => {
|
||||||
|
console.error(`Error cleaning files: ${error.message}`);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user