mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 09:10:35 +08:00
Perf: speed up download previous build
This commit is contained in:
parent
6b324f4079
commit
a02038704f
@ -17,17 +17,24 @@ const fileExists = (path) => {
|
||||
(async () => {
|
||||
const filesList = [];
|
||||
|
||||
let allFileExists = true;
|
||||
|
||||
for await (const line of readFileByLine(resolve(__dirname, '../.gitignore'))) {
|
||||
if (line.startsWith('List/') && !line.endsWith('/')) {
|
||||
filesList.push(line);
|
||||
if (
|
||||
(
|
||||
line.startsWith('List/')
|
||||
|| line.startsWith('Modules/')
|
||||
) && !line.endsWith('/')
|
||||
) {
|
||||
allFileExists = await fileExists(join(__dirname, '..', line));
|
||||
|
||||
if (!allFileExists) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
!((await Promise.all(
|
||||
filesList.map(p => fileExists(join(__dirname, '..', p)))
|
||||
)).some(exist => !exist))
|
||||
) {
|
||||
if (allFileExists) {
|
||||
console.log('All files exists, skip download.');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -83,7 +83,6 @@ module.exports.DOMESTICS = /** @type {const} */({
|
||||
]
|
||||
},
|
||||
BYTEDANCE: {
|
||||
// Currently, bytedance all NS are pointed to AliDNS
|
||||
dns: '180.184.2.2',
|
||||
domains: [
|
||||
'bytecdn.cn',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user