Require macos applications to be in some applications directory

This commit is contained in:
crschnick 2024-01-01 15:57:35 +00:00
parent 88086dc322
commit 8a684caf1b

View file

@ -65,13 +65,9 @@ public abstract class ExternalApplicationType implements PrefsChoiceValue {
}
}).sorted(Comparator.comparingInt(value -> value.length())).toList();
// Prefer app in proper applications directory
var app = valid.stream().filter(s -> s.contains("/Applications")).findFirst();
if (app.isPresent()) {
return app.map(Path::of);
}
return valid.stream().findFirst().map(Path::of);
// Require app in proper applications directory
var app = valid.stream().filter(s -> s.contains("Applications")).findFirst();
return app.map(Path::of);
}
} catch (Exception e) {
ErrorEvent.fromThrowable(e).omit().handle();