Skip to content

Commit 5dd9a3c

Browse files
committed
Show name of system in path check
1 parent ed60342 commit 5dd9a3c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/src/main/java/io/xpipe/app/prefs/ExternalTerminalType.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ protected Optional<Path> determinePath() {
125125
@Override
126126
public void launch(String name, String file, boolean elevated) throws Exception {
127127
try (ShellControl pc = LocalStore.getShell()) {
128-
ApplicationHelper.checkSupport(pc, executable, getDisplayName());
128+
ApplicationHelper.checkSupport(pc, executable, getDisplayName(), null);
129129

130130
var toExecute = executable + " " + toCommand(name, file);
131131
// In order to fix this bug which also affects us:
@@ -367,7 +367,7 @@ public void launch(String name, String file, boolean elevated) throws Exception
367367
try (ShellControl pc = LocalStore.getShell()
368368
.subShell(ShellDialects.POWERSHELL)
369369
.start()) {
370-
ApplicationHelper.checkSupport(pc, executable, displayName);
370+
ApplicationHelper.checkSupport(pc, executable, displayName, null);
371371
var toExecute = "Start-Process \"" + executable + "\" -Verb RunAs -ArgumentList \""
372372
+ toCommand(name, file).replaceAll("\"", "`\"") + "\"";
373373
pc.executeSimpleCommand(toExecute);
@@ -377,7 +377,7 @@ public void launch(String name, String file, boolean elevated) throws Exception
377377
}
378378

379379
try (ShellControl pc = LocalStore.getShell()) {
380-
ApplicationHelper.checkSupport(pc, executable, displayName);
380+
ApplicationHelper.checkSupport(pc, executable, displayName, null);
381381

382382
var toExecute = executable + " " + toCommand(name, file);
383383
if (pc.getOsType().equals(OsType.WINDOWS)) {

app/src/main/java/io/xpipe/app/util/ApplicationHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ public static boolean isInPath(ShellControl processControl, String executable) t
2727
processControl.getShellDialect().getWhichCommand(executable));
2828
}
2929

30-
public static void checkSupport(ShellControl processControl, String executable, String displayName)
30+
public static void checkSupport(ShellControl processControl, String executable, String displayName, String connectionName)
3131
throws Exception {
3232
if (!isInPath(processControl, executable)) {
33-
throw new IOException(displayName + " executable " + executable + " not found in PATH");
33+
throw new IOException(displayName + " executable " + executable + " not found in PATH" + (connectionName != null ? " on system " + connectionName : ""));
3434
}
3535
}
3636
}

0 commit comments

Comments
 (0)