Fix Linux/MacOS issues

This commit is contained in:
modmuss50 2019-11-15 09:11:04 +00:00
parent 68c7f793b3
commit 11af956c84

View file

@ -106,7 +106,7 @@ public class RunConfig {
default:
runConfig.mainClass = "net.fabricmc.devlaunchinjector.Main";
runConfig.programArgs = "";
runConfig.vmArgs = "-Dfabric.dli.config=\"" + extension.getDevLauncherConfig().getAbsolutePath() + "\" -Dfabric.dli.env=" + mode.toLowerCase();
runConfig.vmArgs = "-Dfabric.dli.config=" + quoteIfNeeded(extension.getDevLauncherConfig().getAbsolutePath()) + " -Dfabric.dli.env=" + mode.toLowerCase();
break;
}
@ -218,4 +218,12 @@ public class RunConfig {
throw new RuntimeException("Failed to find mainclass");
}
private static String quoteIfNeeded(String input) {
if (!input.contains(" ")) {
return input;
}
return String.format("\"%s\"", input);
}
}