only installs cursemod with exact name match
This commit is contained in:
10
src/curse.js
10
src/curse.js
@ -9,7 +9,15 @@ function main() {
|
|||||||
if(global.config.mods.curse.length === 0) globCallback("curse", {});
|
if(global.config.mods.curse.length === 0) globCallback("curse", {});
|
||||||
global.config.mods.curse.forEach(mod => {
|
global.config.mods.curse.forEach(mod => {
|
||||||
getData(`search?categoryId=0&gameId=432&gameVersion=${encodeURI(global.config.gameVersion)}&index=0&pageSize=15&searchFilter=${encodeURI(mod)}§ionId=6&sort=0`, (result) => { // resolve projectID
|
getData(`search?categoryId=0&gameId=432&gameVersion=${encodeURI(global.config.gameVersion)}&index=0&pageSize=15&searchFilter=${encodeURI(mod)}§ionId=6&sort=0`, (result) => { // resolve projectID
|
||||||
resolveDep(result[0].id, downloadMods);
|
let i = 0;
|
||||||
|
while(result[i].name !== mod) {
|
||||||
|
++i;
|
||||||
|
if(i === result.length) {
|
||||||
|
console.log(`cursemod ${mod} not found`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resolveDep(result[i].id, downloadMods);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,11 +59,11 @@ function build(repo, repoPath, gitRepo) {
|
|||||||
fs.readFile(`${repoPath}/gradle.properties`, "utf-8", (err, data) => {
|
fs.readFile(`${repoPath}/gradle.properties`, "utf-8", (err, data) => {
|
||||||
if(err) throw err;
|
if(err) throw err;
|
||||||
g2js.parseText(data).then((gradleProp) => {
|
g2js.parseText(data).then((gradleProp) => {
|
||||||
if(newLock.filename != null) fs.unlink(util.modPath(newLock) (err) => {
|
if(newLock.filename != null) fs.unlink(util.modPath(newLock), (err) => {
|
||||||
if(err) throw err;
|
if(err) throw err;
|
||||||
});
|
});
|
||||||
newLock.filename = `${gradleProp.archives_base_name}-${gradleProp.mod_version}.jar`;
|
newLock.filename = `${gradleProp.archives_base_name}-${gradleProp.mod_version}.jar`;
|
||||||
fs.copyFile(`${buildPath}/${newLock.filename}`, util.modPath(newLock) (err) => {
|
fs.copyFile(`${buildPath}/${newLock.filename}`, util.modPath(newLock), (err) => {
|
||||||
if(err) throw err;
|
if(err) throw err;
|
||||||
});
|
});
|
||||||
cbDecrease();
|
cbDecrease();
|
||||||
|
|||||||
Reference in New Issue
Block a user