mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-16 01:08:00 +12:00
More mac fixes
This commit is contained in:
parent
650be3cf93
commit
be541d92aa
1 changed files with 5 additions and 1 deletions
|
@ -38,7 +38,11 @@ public abstract class ExternalApplicationType implements PrefsChoiceValue {
|
||||||
|
|
||||||
protected Optional<Path> getApplicationPath() {
|
protected Optional<Path> getApplicationPath() {
|
||||||
try (ShellProcessControl pc = ShellStore.local().create().start()) {
|
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()) {
|
try (var c = pc.command(String.format(
|
||||||
|
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister " +
|
||||||
|
"-dump | grep -o \"/.*%s.app\" | grep -v -E \"Caches|TimeMachine|Temporary|/Volumes/%s\" | uniq)'",
|
||||||
|
applicationName, applicationName))
|
||||||
|
.start()) {
|
||||||
var path = c.readOnlyStdout();
|
var path = c.readOnlyStdout();
|
||||||
if (c.getExitCode() != 0) {
|
if (c.getExitCode() != 0) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|
Loading…
Reference in a new issue