Fix Linux/MacOS issues

dev/0.11
modmuss50 2019-11-15 09:11:04 +00:00
parent 68c7f793b3
commit 11af956c84
1 changed files with 9 additions and 1 deletions

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);
}
}