mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-06-30 20:10:57 +12:00
Require macos applications to be in some applications directory
This commit is contained in:
parent
88086dc322
commit
8a684caf1b
|
@ -65,13 +65,9 @@ public abstract class ExternalApplicationType implements PrefsChoiceValue {
|
||||||
}
|
}
|
||||||
}).sorted(Comparator.comparingInt(value -> value.length())).toList();
|
}).sorted(Comparator.comparingInt(value -> value.length())).toList();
|
||||||
|
|
||||||
// Prefer app in proper applications directory
|
// Require app in proper applications directory
|
||||||
var app = valid.stream().filter(s -> s.contains("/Applications")).findFirst();
|
var app = valid.stream().filter(s -> s.contains("Applications")).findFirst();
|
||||||
if (app.isPresent()) {
|
return app.map(Path::of);
|
||||||
return app.map(Path::of);
|
|
||||||
}
|
|
||||||
|
|
||||||
return valid.stream().findFirst().map(Path::of);
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ErrorEvent.fromThrowable(e).omit().handle();
|
ErrorEvent.fromThrowable(e).omit().handle();
|
||||||
|
|
Loading…
Reference in a new issue