Collect speedtest.net endpoint

This commit is contained in:
SukkaW
2023-08-04 20:55:32 +08:00
parent ae5eb475dd
commit 792fbeda3d
7 changed files with 149 additions and 14 deletions

View File

@@ -46,11 +46,16 @@ const fileExists = (path) => {
})
);
await Promise.all(filesList.map(p => fse.copy(
join(extractedPath, 'Surge-gh-pages', p),
join(__dirname, '..', p),
{ overwrite: true }
)));
await Promise.all(filesList.map(async p => {
const src = join(extractedPath, 'Surge-gh-pages', p);
if (await fileExists(src)) {
return fse.copy(
src,
join(__dirname, '..', p),
{ overwrite: true }
);
}
}));
await fs.promises.unlink(extractedPath).catch(() => { });
})();