From 5dd9a3c98486ceea11c60846eb4710959562ed6b Mon Sep 17 00:00:00 2001 From: crschnick Date: Thu, 8 Jun 2023 16:23:46 +0000 Subject: [PATCH] Show name of system in path check --- .../main/java/io/xpipe/app/prefs/ExternalTerminalType.java | 6 +++--- app/src/main/java/io/xpipe/app/util/ApplicationHelper.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/prefs/ExternalTerminalType.java b/app/src/main/java/io/xpipe/app/prefs/ExternalTerminalType.java index b2fa2c45..de89130e 100644 --- a/app/src/main/java/io/xpipe/app/prefs/ExternalTerminalType.java +++ b/app/src/main/java/io/xpipe/app/prefs/ExternalTerminalType.java @@ -125,7 +125,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue { @Override public void launch(String name, String file, boolean elevated) throws Exception { try (ShellControl pc = LocalStore.getShell()) { - ApplicationHelper.checkSupport(pc, executable, getDisplayName()); + ApplicationHelper.checkSupport(pc, executable, getDisplayName(), null); var toExecute = executable + " " + toCommand(name, file); // In order to fix this bug which also affects us: @@ -367,7 +367,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue { try (ShellControl pc = LocalStore.getShell() .subShell(ShellDialects.POWERSHELL) .start()) { - ApplicationHelper.checkSupport(pc, executable, displayName); + ApplicationHelper.checkSupport(pc, executable, displayName, null); var toExecute = "Start-Process \"" + executable + "\" -Verb RunAs -ArgumentList \"" + toCommand(name, file).replaceAll("\"", "`\"") + "\""; pc.executeSimpleCommand(toExecute); @@ -377,7 +377,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue { } try (ShellControl pc = LocalStore.getShell()) { - ApplicationHelper.checkSupport(pc, executable, displayName); + ApplicationHelper.checkSupport(pc, executable, displayName, null); var toExecute = executable + " " + toCommand(name, file); if (pc.getOsType().equals(OsType.WINDOWS)) { diff --git a/app/src/main/java/io/xpipe/app/util/ApplicationHelper.java b/app/src/main/java/io/xpipe/app/util/ApplicationHelper.java index ebe572ad..aa135424 100644 --- a/app/src/main/java/io/xpipe/app/util/ApplicationHelper.java +++ b/app/src/main/java/io/xpipe/app/util/ApplicationHelper.java @@ -27,10 +27,10 @@ public class ApplicationHelper { processControl.getShellDialect().getWhichCommand(executable)); } - public static void checkSupport(ShellControl processControl, String executable, String displayName) + public static void checkSupport(ShellControl processControl, String executable, String displayName, String connectionName) throws Exception { if (!isInPath(processControl, executable)) { - throw new IOException(displayName + " executable " + executable + " not found in PATH"); + throw new IOException(displayName + " executable " + executable + " not found in PATH" + (connectionName != null ? " on system " + connectionName : "")); } } }