mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-03 04:21:53 +08:00
Perf: run a few task during downloading previous dist
This commit is contained in:
@@ -18,20 +18,22 @@ const MAGIC_COMMAND_SGMODULE_MITM_HOSTNAMES = '# $ sgmodule_mitm_hostnames ';
|
||||
|
||||
const domainsetSrcFolder = 'domainset' + path.sep;
|
||||
|
||||
const clawSourceDirPromise = new Fdir()
|
||||
.withRelativePaths()
|
||||
.filter((filepath, isDirectory) => {
|
||||
if (isDirectory) return true;
|
||||
|
||||
const extname = path.extname(filepath);
|
||||
|
||||
return !(extname === '.js' || extname === '.ts');
|
||||
})
|
||||
.crawl(SOURCE_DIR)
|
||||
.withPromise();
|
||||
|
||||
export const buildCommon = task(require.main === module, __filename)(async (span) => {
|
||||
const promises: Array<Promise<unknown>> = [];
|
||||
|
||||
const paths = await new Fdir()
|
||||
.withRelativePaths()
|
||||
.filter((filepath, isDirectory) => {
|
||||
if (isDirectory) return true;
|
||||
|
||||
const extname = path.extname(filepath);
|
||||
|
||||
return !(extname === '.js' || extname === '.ts');
|
||||
})
|
||||
.crawl(SOURCE_DIR)
|
||||
.withPromise();
|
||||
const paths = await clawSourceDirPromise;
|
||||
|
||||
for (let i = 0, len = paths.length; i < len; i++) {
|
||||
const relativePath = paths[i];
|
||||
|
||||
Reference in New Issue
Block a user