From ec10f3dcabc877b1fd7ac1f1d99c005dd9ac6330 Mon Sep 17 00:00:00 2001 From: Christopher Schnick Date: Fri, 16 Dec 2022 21:45:07 +0100 Subject: [PATCH] Fix bug in beacon server launch (again) --- .../main/java/io/xpipe/beacon/BeaconServer.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java b/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java index c386d2b4..25a29ea1 100644 --- a/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java +++ b/beacon/src/main/java/io/xpipe/beacon/BeaconServer.java @@ -42,12 +42,14 @@ public class BeaconServer { } public static Process start(String installationBase) throws Exception { - var daemonExecutable = getDaemonDebugExecutable(installationBase); - // Tell daemon that we launched from an external tool - var command = BeaconConfig.launchDaemonInDebugMode() - ? XPipeInstallation.createExternalAsyncLaunchCommand( - installationBase, BeaconConfig.getDaemonArguments()) - : XPipeInstallation.createExternalLaunchCommand(getDaemonDebugExecutable(installationBase), BeaconConfig.getDaemonArguments()); + String command; + if (!BeaconConfig.launchDaemonInDebugMode()) { + command = XPipeInstallation.createExternalAsyncLaunchCommand(installationBase, BeaconConfig.getDaemonArguments()); + } else { + command = XPipeInstallation.createExternalLaunchCommand( + getDaemonDebugExecutable(installationBase), BeaconConfig.getDaemonArguments()); + } + Process process = Runtime.getRuntime().exec(ShellTypes.getPlatformDefault().executeCommandWithShell(command)); printDaemonOutput(process, command); @@ -117,8 +119,7 @@ public class BeaconServer { return FileNames.join( installationBase, XPipeInstallation.getDaemonDebugAttachScriptPath(pc.getOsType())); } else { - return FileNames.join( - installationBase, XPipeInstallation.getDaemonDebugScriptPath(pc.getOsType())); + return FileNames.join(installationBase, XPipeInstallation.getDaemonDebugScriptPath(pc.getOsType())); } } }