Compare commits

...

2 Commits

Author SHA1 Message Date
1fddcd7598 print more information 2021-01-22 12:32:54 +01:00
cff3d36e54 handle error if right cursemod version is not found 2021-01-22 10:54:10 +01:00
2 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,11 @@ function resolveDep(modId, callback) {
rightVersion = files[i];
}
}
if(rightVersion === undefined) {
getData(modId, (mod) => {
console.log(`cursemod ${mod.name}: no version for the correct minecraft version and modloader found`);
});
return;
dep.set(String(modId), {fileId: rightVersion.id, url: rightVersion.downloadUrl, filename: rightVersion.fileName});
rightVersion.dependencies.forEach(mod => {
if(mod.type !== 3) return;

View File

@ -19,6 +19,7 @@ function main () {
fs.access(repoPath, (err) => {
if(err) {
if(err.code !== "ENOENT") throw err;
console.log(`cloning git repo ${gitRepo.url}`);
git.clone(gitRepo.url, repoPath, undefined, gitRepo.branch, (err, repo) => {
if(err) throw err;
build(repo, repoPath, gitRepo);
@ -26,6 +27,7 @@ function main () {
}
else {
let repo = git(repoPath);
console.log(`pulling git repo ${gitRepo.url}`);
repo.pull(["origin"], gitRepo.branch, (err) => {
if(err) throw err;
build(repo, repoPath, gitRepo);
@ -53,6 +55,7 @@ function build(repo, repoPath, gitRepo) {
if(commit.id === newLock.commitId) cbDecrease();
else {
newLock.commitId = commit.id;
console.log(`buidling ${gitRepo.url}`);
childProcess.execFile("gradle", ["build"], {cwd: repoPath}, (err) => {
if(err) throw err;
let buildPath = `${repoPath}/build/libs`;