More fixes for mac

This commit is contained in:
crschnick
2023-02-04 08:40:15 +00:00
parent ded82617e6
commit fd05f9bb0f
4 changed files with 89 additions and 54 deletions

View File

@@ -40,7 +40,7 @@ public abstract class ExternalApplicationType implements PrefsChoiceValue {
try (ShellProcessControl pc = ShellStore.local().create().start()) {
try (var c = pc.command(String.format("osascript -e 'POSIX path of (path to application \"%s\")'", applicationName)).start()) {
var path = c.readOnlyStdout();
if (!c.waitFor()) {
if (c.getExitCode() != 0) {
return Optional.empty();
}
return Optional.of(Path.of(path));