mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-19 02:39:01 +12:00
Fix Linux editor detection
This commit is contained in:
parent
e7bcb835a2
commit
f140e1312e
2 changed files with 14 additions and 2 deletions
|
@ -38,9 +38,9 @@ It comes with the following main features:
|
||||||
- Exclusively uses established CLI tools and therefore works out of the box on most systems and doesn't require any additional setup
|
- Exclusively uses established CLI tools and therefore works out of the box on most systems and doesn't require any additional setup
|
||||||
- Allows you to customize the launched shell's init environment
|
- Allows you to customize the launched shell's init environment
|
||||||
|
|
||||||
#### Simple connection Management
|
#### All your connections in one place
|
||||||
|
|
||||||
- Easily create and manage all kinds of remote connections
|
- Easily create and manage all kinds of remote connections at one location
|
||||||
- Securely stores all information exclusively on your computer and encrypts all secret information
|
- Securely stores all information exclusively on your computer and encrypts all secret information
|
||||||
- Allows you to share connection configurations to any other trusted party through shareable URLs
|
- Allows you to share connection configurations to any other trusted party through shareable URLs
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
package io.xpipe.app.prefs;
|
package io.xpipe.app.prefs;
|
||||||
|
|
||||||
import io.xpipe.core.process.OsType;
|
import io.xpipe.core.process.OsType;
|
||||||
|
import io.xpipe.core.process.ShellProcessControl;
|
||||||
import io.xpipe.core.process.ShellTypes;
|
import io.xpipe.core.process.ShellTypes;
|
||||||
|
import io.xpipe.core.store.ShellStore;
|
||||||
|
import io.xpipe.extension.event.ErrorEvent;
|
||||||
import io.xpipe.extension.prefs.PrefsChoiceValue;
|
import io.xpipe.extension.prefs.PrefsChoiceValue;
|
||||||
import io.xpipe.extension.util.ApplicationHelper;
|
import io.xpipe.extension.util.ApplicationHelper;
|
||||||
import io.xpipe.extension.util.WindowsRegistry;
|
import io.xpipe.extension.util.WindowsRegistry;
|
||||||
|
@ -136,6 +139,15 @@ public abstract class ExternalEditorType implements PrefsChoiceValue {
|
||||||
new ProcessBuilder(list).start();
|
new ProcessBuilder(list).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAvailable() {
|
||||||
|
try (ShellProcessControl pc = ShellStore.local().create().start()) {
|
||||||
|
return pc.executeBooleanSimpleCommand(pc.getShellType().getWhichCommand(command));
|
||||||
|
} catch (Exception e) {
|
||||||
|
ErrorEvent.fromThrowable(e).omit().handle();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSelectable() {
|
public boolean isSelectable() {
|
||||||
return OsType.getLocal().equals(OsType.LINUX);
|
return OsType.getLocal().equals(OsType.LINUX);
|
||||||
|
|
Loading…
Reference in a new issue