增加自动下载
This commit is contained in:
@ -105,9 +105,6 @@ async function downloadFromURL(name, url, resolver) {
|
||||
|
||||
if (!checkFile(saveName)) {
|
||||
console.log(`开始下载${name}, 地址:${url}`);
|
||||
await fetch(url).then(res => {
|
||||
console.log(res.status)
|
||||
})
|
||||
const result = spawnSync("curl", ["-o", saveName + ".cache", "-L", url, "-s", "-w", "%{http_code}"], { ...spawnOption, stdio: "pipe" });
|
||||
assert(result.status == 0 && result.stdout.toString() == "200", `下载${name}失败`);
|
||||
fs.renameSync(saveName + ".cache", saveName);
|
||||
|
Reference in New Issue
Block a user