Fix: keep not completed Curse modpack game version
This commit is contained in:
@@ -107,9 +107,6 @@ public final class ModpackHelper {
|
|||||||
if (ex instanceof CurseCompletionException && !(ex.getCause() instanceof FileNotFoundException)) {
|
if (ex instanceof CurseCompletionException && !(ex.getCause() instanceof FileNotFoundException)) {
|
||||||
success.run();
|
success.run();
|
||||||
// This is tolerable and we will not delete the game
|
// This is tolerable and we will not delete the game
|
||||||
} else {
|
|
||||||
HMCLGameRepository repository = profile.getRepository();
|
|
||||||
repository.removeVersionFromDisk(name);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import org.jackhuang.hmcl.util.gson.JsonUtils;
|
|||||||
import org.jackhuang.hmcl.util.io.FileUtils;
|
import org.jackhuang.hmcl.util.io.FileUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
@@ -84,7 +85,12 @@ public final class CurseInstallTask extends Task<Void> {
|
|||||||
dependents.add(builder.buildAsync());
|
dependents.add(builder.buildAsync());
|
||||||
|
|
||||||
onDone().register(event -> {
|
onDone().register(event -> {
|
||||||
if (event.isFailed()) repository.removeVersionFromDisk(name);
|
Exception ex = event.getTask().getException();
|
||||||
|
if (event.isFailed()) {
|
||||||
|
if (!(ex instanceof CurseCompletionException) || ex.getCause() instanceof FileNotFoundException) {
|
||||||
|
repository.removeVersionFromDisk(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ModpackConfiguration<CurseManifest> config = null;
|
ModpackConfiguration<CurseManifest> config = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user