mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-07-02 21:11:03 +12:00
Fix macOS program detection
This commit is contained in:
parent
bb519fcd1b
commit
6ca4b056e7
|
@ -40,11 +40,11 @@ public abstract class ExternalApplicationType implements PrefsChoiceValue {
|
|||
try (ShellControl pc = LocalStore.getShell().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",
|
||||
+ "-dump | grep -o \"/.*%s.app\" | grep -v -E \"Caches|TimeMachine|Temporary|.Trash|/Volumes/%s\" | uniq",
|
||||
applicationName, applicationName))
|
||||
.start()) {
|
||||
var path = c.readStdoutDiscardErr();
|
||||
if (c.getExitCode() != 0) {
|
||||
if (c.getExitCode() != 0 || path.isBlank()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
return Optional.of(Path.of(path));
|
||||
|
|
|
@ -227,7 +227,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
|||
static class ITerm2Type extends ExternalApplicationType.MacApplication implements ExternalTerminalType {
|
||||
|
||||
public ITerm2Type() {
|
||||
super("iterm2", "iTerm2");
|
||||
super("iterm2", "iTerm");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue