extra params in registry and try-catch
This commit is contained in:
parent
adfd45427e
commit
5e7b7bd03c
12
main.js
12
main.js
@ -14,14 +14,18 @@ modList.forEach((ele, idx, arr) => {
|
||||
|
||||
let link = modDownloads[ele];
|
||||
let modinfo = {
|
||||
modName: ""
|
||||
modName: "",
|
||||
link: link
|
||||
}
|
||||
|
||||
let output = cp.execSync("cd /root/mcserver/mods && wget --content-disposition " + link).toString('utf-8'); //change dir and download mod
|
||||
console.log(output);
|
||||
|
||||
modinfo.modName = output.match(/(["'])(?:(?=(\\?))\2.)*?\1/)[0];//kill myself?
|
||||
modinfo.modName = modinfo.modName.substring(1, modinfo.modName.length - 1);
|
||||
try {
|
||||
modinfo.modName = output.match(/(["'])(?:(?=(\\?))\2.)*?\1/)[0];//kill myself?
|
||||
modinfo.modName = modinfo.modName.substring(1, modinfo.modName.length - 1);
|
||||
} catch{
|
||||
modinfo.modName = "*" + ele;
|
||||
}
|
||||
|
||||
console.log("\n\n\n\n\n\n" + modinfo.modName + "\n\n\n\n\n\n");
|
||||
registry[ele] = modinfo;
|
||||
|
Loading…
x
Reference in New Issue
Block a user