mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 17:20:35 +08:00
Update CDN Hosts
This commit is contained in:
parent
aedcddff9f
commit
16bbc886d1
@ -8,6 +8,12 @@ const { Stream, Readable } = require('stream');
|
|||||||
const { promisify } = require('util');
|
const { promisify } = require('util');
|
||||||
const pipeline = promisify(Stream.pipeline);
|
const pipeline = promisify(Stream.pipeline);
|
||||||
|
|
||||||
|
const fileExists = (path) => {
|
||||||
|
return fs.promises.access(path, fs.constants.F_OK)
|
||||||
|
.then(() => true)
|
||||||
|
.catch(() => false);
|
||||||
|
};
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const filesList = (
|
const filesList = (
|
||||||
await fs.promises.readFile(resolve(__dirname, '../.gitignore'), { encoding: 'utf-8' })
|
await fs.promises.readFile(resolve(__dirname, '../.gitignore'), { encoding: 'utf-8' })
|
||||||
@ -15,6 +21,11 @@ const pipeline = promisify(Stream.pipeline);
|
|||||||
.split('\n')
|
.split('\n')
|
||||||
.filter(p => p.startsWith('List/'));
|
.filter(p => p.startsWith('List/'));
|
||||||
|
|
||||||
|
if (
|
||||||
|
(await Promise.all(
|
||||||
|
filesList.map(p => fileExists(join(__dirname, '..', p)))
|
||||||
|
)).some(exist => !exist)
|
||||||
|
) {
|
||||||
const tempFile = join(tmpdir(), `sukka-surge-last-build-tar-${Date.now()}`);
|
const tempFile = join(tmpdir(), `sukka-surge-last-build-tar-${Date.now()}`);
|
||||||
const resp = await fetch('https://codeload.github.com/sukkaw/surge/tar.gz/gh-pages');
|
const resp = await fetch('https://codeload.github.com/sukkaw/surge/tar.gz/gh-pages');
|
||||||
const readableNodeStream = Readable.fromWeb(resp.body);
|
const readableNodeStream = Readable.fromWeb(resp.body);
|
||||||
@ -41,6 +52,9 @@ const pipeline = promisify(Stream.pipeline);
|
|||||||
}
|
}
|
||||||
)))
|
)))
|
||||||
|
|
||||||
await fs.promises.unlink(tempFile).catch(() => {});
|
await fs.promises.unlink(tempFile).catch(() => { });
|
||||||
await fs.promises.unlink(extractedPath).catch(() => {});
|
await fs.promises.unlink(extractedPath).catch(() => { });
|
||||||
|
} else {
|
||||||
|
console.log('All files exists, skip download.');
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
@ -878,6 +878,10 @@ static-cdn.mastodon.social
|
|||||||
.wsimg.com
|
.wsimg.com
|
||||||
# SurveyMonkey
|
# SurveyMonkey
|
||||||
.smassets.net
|
.smassets.net
|
||||||
|
# Envato
|
||||||
|
.envato-static.com
|
||||||
|
.envatousercontent.com
|
||||||
|
s3.envato.com
|
||||||
# Others
|
# Others
|
||||||
.yelpcdn.com
|
.yelpcdn.com
|
||||||
cf-images.us-east-1.prod.boltdns.net
|
cf-images.us-east-1.prod.boltdns.net
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
.nitro.download
|
.nitro.download
|
||||||
.download.mokeedev.com
|
.download.mokeedev.com
|
||||||
|
|
||||||
|
get.pixelexperience.org
|
||||||
|
download.pixelexperience.org
|
||||||
|
|
||||||
# >> MEGA
|
# >> MEGA
|
||||||
|
|
||||||
.mega.nz
|
.mega.nz
|
||||||
|
|||||||
@ -52,7 +52,10 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"build:telegram-cidr": {
|
"build:telegram-cidr": {
|
||||||
"command": "node ./Build/build-telegram-cidr.js"
|
"command": "node ./Build/build-telegram-cidr.js",
|
||||||
|
"dependencies": [
|
||||||
|
"download-previous-build"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"build:chn-cidr": {
|
"build:chn-cidr": {
|
||||||
"command": "node ./Build/build-chn-cidr.js",
|
"command": "node ./Build/build-chn-cidr.js",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user