Skip to content

Commit

Permalink
fix: if spaces in the game folder
Browse files Browse the repository at this point in the history
  • Loading branch information
70CentsApple committed Jul 22, 2023
1 parent c3d8f9c commit 907066e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static void toastWithPython(String caption, String text) {
Thread thread = new Thread(() -> {
var file = new File(FabricLoader.getInstance().getGameDir() + "/chattools/", "ChatToolsToast.exe");
var iconFile = new File(FabricLoader.getInstance().getGameDir() + "/chattools/", "ChatToolsIcon.ico");
String command = String.format("%s %s %s %s", file, '"'+caption+'"', '"'+text.replace("\n","\\n")+'"', iconFile);
String command = String.format("%s %s %s %s", '"' + file.toString() + '"', '"' + caption + '"', '"' + text.replace("\n", "\\n") + '"', iconFile);
ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c", command);
builder.redirectErrorStream(true);
try {
Expand All @@ -117,7 +117,7 @@ public static void toastWithPython(String caption, String text) {
while ((line = reader.readLine()) != null) {
ChatTools.LOGGER.info(line);
}
} catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
});
Expand Down

0 comments on commit 907066e

Please sign in to comment.