chore: update scripts.
This commit is contained in:
parent
4505675c8a
commit
84a545cbf6
@ -56,17 +56,21 @@ export async function createHTML(files = [], num = 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function run() {
|
export async function run() {
|
||||||
await fs.ensureDir(OUTOUT);
|
try {
|
||||||
await fs.emptyDir(OUTOUT);
|
await fs.ensureDir(OUTOUT);
|
||||||
await fs.ensureDir(path.resolve(OUTOUT, 'style'));
|
await fs.emptyDir(OUTOUT);
|
||||||
await fs.ensureFile(SEARCH_DATA_CACHE);
|
await fs.ensureDir(path.resolve(OUTOUT, 'style'));
|
||||||
await fs.writeFile(SEARCH_DATA_CACHE, '{}');
|
await fs.ensureFile(SEARCH_DATA_CACHE);
|
||||||
await fs.writeFile(SEARCH_DATA, '[]');
|
await fs.writeFile(SEARCH_DATA_CACHE, '{}');
|
||||||
await fs.copy(path.resolve(process.cwd(), 'scripts/style'), path.resolve(OUTOUT, 'style'));
|
await fs.writeFile(SEARCH_DATA, '[]');
|
||||||
const files = await recursiveReaddirFiles(process.cwd(), {
|
await fs.copy(path.resolve(process.cwd(), 'scripts/style'), path.resolve(OUTOUT, 'style'));
|
||||||
ignored: /\/(node_modules|\.git)/,
|
const files = await recursiveReaddirFiles(process.cwd(), {
|
||||||
exclude: /(\.json|\.mjs|CONTRIBUTING\.md)$/,
|
ignored: /\/(node_modules|\.git)/,
|
||||||
filter: (item) => item.ext === 'md',
|
exclude: /(\.json|\.mjs|CONTRIBUTING\.md)$/,
|
||||||
});
|
filter: (item) => item.ext === 'md',
|
||||||
createHTML(files);
|
});
|
||||||
|
createHTML(files);
|
||||||
|
} catch (error) {
|
||||||
|
console.log('ERR:', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user