mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-24 16:40:25 +00:00
Improve windows terminal missing error message
This commit is contained in:
parent
411e9c17b6
commit
e80cf7e4b0
1 changed files with 9 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
package io.xpipe.app.terminal;
|
package io.xpipe.app.terminal;
|
||||||
|
|
||||||
|
import io.xpipe.app.issue.ErrorEvent;
|
||||||
import io.xpipe.app.util.LocalShell;
|
import io.xpipe.app.util.LocalShell;
|
||||||
import io.xpipe.core.process.CommandBuilder;
|
import io.xpipe.core.process.CommandBuilder;
|
||||||
import io.xpipe.core.store.FileNames;
|
import io.xpipe.core.store.FileNames;
|
||||||
|
@ -67,6 +68,10 @@ public interface WindowsTerminalType extends ExternalTerminalType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void launch(LaunchConfiguration configuration) throws Exception {
|
public void launch(LaunchConfiguration configuration) throws Exception {
|
||||||
|
if (!isAvailable()) {
|
||||||
|
throw ErrorEvent.expected(new IllegalArgumentException("Windows Terminal Preview is not installed"));
|
||||||
|
}
|
||||||
|
|
||||||
LocalShell.getShell()
|
LocalShell.getShell()
|
||||||
.executeSimpleCommand(
|
.executeSimpleCommand(
|
||||||
CommandBuilder.of().addFile(getPath().toString()).add(toCommand(configuration)));
|
CommandBuilder.of().addFile(getPath().toString()).add(toCommand(configuration)));
|
||||||
|
@ -98,6 +103,10 @@ public interface WindowsTerminalType extends ExternalTerminalType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void launch(LaunchConfiguration configuration) throws Exception {
|
public void launch(LaunchConfiguration configuration) throws Exception {
|
||||||
|
if (!isAvailable()) {
|
||||||
|
throw ErrorEvent.expected(new IllegalArgumentException("Windows Terminal Canary is not installed"));
|
||||||
|
}
|
||||||
|
|
||||||
LocalShell.getShell()
|
LocalShell.getShell()
|
||||||
.executeSimpleCommand(
|
.executeSimpleCommand(
|
||||||
CommandBuilder.of().addFile(getPath().toString()).add(toCommand(configuration)));
|
CommandBuilder.of().addFile(getPath().toString()).add(toCommand(configuration)));
|
||||||
|
|
Loading…
Reference in a new issue