From 22619224c5d279325f5713f9df9829fa38b6d5ce Mon Sep 17 00:00:00 2001 From: Christopher Schnick Date: Thu, 15 Dec 2022 21:52:29 +0100 Subject: [PATCH] Small bug fixes --- beacon/src/main/java/io/xpipe/beacon/BeaconServer.java | 3 ++- core/src/main/java/io/xpipe/core/util/XPipeInstallation.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java b/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java index 1a0d98f26..214d50c7d 100644 --- a/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java +++ b/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java @@ -4,6 +4,7 @@ import io.xpipe.beacon.exchange.StopExchange; import io.xpipe.core.impl.FileNames; import io.xpipe.core.impl.LocalStore; import io.xpipe.core.process.ShellProcessControl; +import io.xpipe.core.process.ShellTypes; import io.xpipe.core.util.XPipeInstallation; import lombok.experimental.UtilityClass; @@ -43,7 +44,7 @@ public class BeaconServer { // Tell daemon that we launched from an external tool var command = "\"" + daemonExecutable + "\" --external " + (BeaconConfig.getDaemonArguments() != null ? BeaconConfig.getDaemonArguments() : ""); - Process process = Runtime.getRuntime().exec(command); + Process process = Runtime.getRuntime().exec(ShellTypes.getPlatformDefault().executeCommandWithShell(command)); printDaemonOutput(process, command); return process; } diff --git a/core/src/main/java/io/xpipe/core/util/XPipeInstallation.java b/core/src/main/java/io/xpipe/core/util/XPipeInstallation.java index eb5fee522..f39314502 100644 --- a/core/src/main/java/io/xpipe/core/util/XPipeInstallation.java +++ b/core/src/main/java/io/xpipe/core/util/XPipeInstallation.java @@ -13,6 +13,10 @@ public class XPipeInstallation { public static String getInstallationBasePathForCLI(ShellProcessControl p, String cliExecutable) throws Exception { var defaultInstallation = getDefaultInstallationBasePath(p, true); + if (cliExecutable == null) { + return defaultInstallation; + } + if (p.getOsType().equals(OsType.LINUX) && cliExecutable.equals("/usr/bin/xpipe")) { return defaultInstallation; }