mirror of
https://github.com/SKCraft/Launcher.git
synced 2024-11-24 12:16:28 +01:00
Try harder to create the initial instance folder on update.
This commit is contained in:
parent
a08825b7ba
commit
b1c14da7e4
@ -8,11 +8,13 @@ package com.skcraft.launcher;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.google.common.io.Files;
|
||||
import com.skcraft.launcher.launch.JavaProcessBuilder;
|
||||
import com.skcraft.launcher.model.modpack.LaunchModifier;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Date;
|
||||
|
||||
@ -69,8 +71,10 @@ public class Instance implements Comparable<Instance> {
|
||||
@JsonIgnore
|
||||
public File getContentDir() {
|
||||
File dir = new File(this.dir, "minecraft");
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
try {
|
||||
Files.createParentDirs(dir);
|
||||
dir.mkdir();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
return dir;
|
||||
}
|
||||
|
@ -66,6 +66,9 @@ public class Updater extends BaseUpdater implements Callable<Instance>, Progress
|
||||
public Instance call() throws Exception {
|
||||
log.info("Checking for an update for '" + instance.getName() + "'...");
|
||||
|
||||
// Force the directory to be created
|
||||
instance.getContentDir();
|
||||
|
||||
boolean updateRequired = !instance.isInstalled();
|
||||
boolean updateDesired = (instance.isUpdatePending() || updateRequired);
|
||||
boolean updateCapable = (instance.getManifestURL() != null);
|
||||
|
Loading…
Reference in New Issue
Block a user