mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-24 09:25:36 +00:00
More flatpak fixes
This commit is contained in:
@@ -2,6 +2,7 @@ package io.xpipe.app.prefs;
|
||||
|
||||
import io.xpipe.app.issue.TrackEvent;
|
||||
import io.xpipe.app.process.CommandBuilder;
|
||||
import io.xpipe.app.process.CommandSupport;
|
||||
import io.xpipe.app.process.LocalShell;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -51,6 +52,10 @@ public class ExternalApplicationHelper {
|
||||
|
||||
public static void startAsync(CommandBuilder b) throws Exception {
|
||||
try (var sc = LocalShell.getShell().start()) {
|
||||
var base = b.buildBaseParts(sc);
|
||||
var exec = base.getFirst();
|
||||
CommandSupport.isInPathOrThrow(sc, exec);
|
||||
|
||||
var cmd = sc.getShellDialect().launchAsnyc(b);
|
||||
TrackEvent.withDebug("Executing local application")
|
||||
.tag("command", b.buildFull(sc))
|
||||
|
||||
@@ -8,6 +8,7 @@ import io.xpipe.app.process.CommandSupport;
|
||||
import io.xpipe.app.process.ShellScript;
|
||||
import io.xpipe.app.terminal.TerminalLaunch;
|
||||
import io.xpipe.app.process.LocalShell;
|
||||
import io.xpipe.app.util.FlatpakCache;
|
||||
import io.xpipe.app.util.WindowsRegistry;
|
||||
import io.xpipe.core.OsType;
|
||||
|
||||
@@ -396,9 +397,14 @@ public interface ExternalEditorType extends PrefsChoiceValue {
|
||||
LinuxType VSCODE_LINUX = new LinuxType("app.vscode", "code", "https://code.visualstudio.com/", "com.visualstudio.code") {
|
||||
@Override
|
||||
public void launch(Path file) throws Exception {
|
||||
var exec = CommandSupport.isInLocalPath(getExecutable()) || getFlatpakId() == null ?
|
||||
var exec = CommandSupport.isInLocalPath(getExecutable()) ?
|
||||
CommandBuilder.of().addFile(getExecutable()) :
|
||||
CommandBuilder.of().add("flatpak", "run").addQuoted(getFlatpakId());
|
||||
|
||||
if (FlatpakCache.getApp(getId()).isEmpty()) {
|
||||
CommandSupport.isInPathOrThrow(LocalShell.getShell(), getExecutable());
|
||||
}
|
||||
|
||||
var builder = CommandBuilder.of()
|
||||
.fixedEnvironment("DONT_PROMPT_WSL_INSTALL", "No_Prompt_please")
|
||||
.add(exec)
|
||||
|
||||
Reference in New Issue
Block a user