Update PluginRepo.plugin.js
This commit is contained in:
parent
5b952e5ffe
commit
f230c510e6
|
@ -14,8 +14,13 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "PluginRepo",
|
"name": "PluginRepo",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "2.1.3",
|
"version": "2.1.4",
|
||||||
"description": "Allow you to look at all plugins from the plugin repo and download them on the fly"
|
"description": "Allow you to look at all plugins from the plugin repo and download them on the fly"
|
||||||
|
},
|
||||||
|
"changeLog": {
|
||||||
|
"progress": {
|
||||||
|
"New Meta Headers": "Adjusted Update Check for new Plugin Meta Headers"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -834,9 +839,11 @@ module.exports = (_ => {
|
||||||
/* code is minified -> add newlines */
|
/* code is minified -> add newlines */
|
||||||
bodyCopy = body.replace(/}/g, "}\n");
|
bodyCopy = body.replace(/}/g, "}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
let bodyWithoutSpecial = bodyCopy.replace(/\n|\r|\t/g, "").replace(/\n|\r|\t/g, "").replace(/\s{2,}/g, "");
|
let bodyWithoutSpecial = bodyCopy.replace(/\n|\r|\t/g, "").replace(/\n|\r|\t/g, "").replace(/\s{2,}/g, "");
|
||||||
let configReg = /(\.exports|config)\s*=\s*\{(.*?)\s*["'`]*info["'`]*\s*:\s*/i.exec(bodyWithoutSpecial);
|
let configFound = false, configReg = /(\.exports|config)\s*=\s*\{(.*?)\s*["'`]*info["'`]*\s*:\s*/i.exec(bodyWithoutSpecial);
|
||||||
if (configReg) {
|
if (configReg) {
|
||||||
|
configFound = true;
|
||||||
try {
|
try {
|
||||||
bodyWithoutSpecial = bodyWithoutSpecial.substring(configReg.index).split(configReg[0])[1].split("};")[0].split("}},")[0].replace(/,([\]\}])/g, "$1");
|
bodyWithoutSpecial = bodyWithoutSpecial.substring(configReg.index).split(configReg[0])[1].split("};")[0].split("}},")[0].replace(/,([\]\}])/g, "$1");
|
||||||
try {extractConfigInfo(plugin, JSON.parse('{"info":' + bodyWithoutSpecial + '}'));}
|
try {extractConfigInfo(plugin, JSON.parse('{"info":' + bodyWithoutSpecial + '}'));}
|
||||||
|
@ -853,13 +860,14 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
try {extractConfigInfo(plugin, JSON.parse(('{"info":' + configString + '}').replace(/'/g, "\"")));}
|
try {extractConfigInfo(plugin, JSON.parse(('{"info":' + configString + '}').replace(/'/g, "\"")));}
|
||||||
catch (err) {}
|
catch (err) {configFound = false;}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (err) {}
|
catch (err) {configFound = false;}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
if (!configFound) {
|
||||||
let hasMETAline = bodyCopy.replace(/\s/g, "").indexOf("//META{");
|
let hasMETAline = bodyCopy.replace(/\s/g, "").indexOf("//META{");
|
||||||
if (!(hasMETAline < 20 && hasMETAline > -1)) {
|
if (!(hasMETAline < 20 && hasMETAline > -1)) {
|
||||||
let searchText = bodyCopy.replace(/[\r\t| ]*\*\s*/g, "*");
|
let searchText = bodyCopy.replace(/[\r\t| ]*\*\s*/g, "*");
|
||||||
|
|
Loading…
Reference in New Issue