mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-05-03 11:20:34 +00:00
Fix broken choco updater
This commit is contained in:
@@ -28,15 +28,15 @@ public class AppRestart {
|
||||
var exec = loc.getCliExecutablePath();
|
||||
return "\"" + exec + "\" open" + suffix;
|
||||
} else {
|
||||
var exe = loc.getDaemonDebugScriptPath();
|
||||
var exe = loc.getDaemonExecutablePath();
|
||||
if (ShellDialects.isPowershell(dialect)) {
|
||||
var escapedList =
|
||||
arguments.stream().map(s -> s.replaceAll("\"", "`\"")).toList();
|
||||
var argumentList = String.join(" ", escapedList);
|
||||
return "Start-Process -FilePath \"" + exe + "\" -ArgumentList \"" + argumentList + "\"";
|
||||
return "echo \"Starting XPipe ...\"; Start-Process -FilePath \"" + exe + "\" -ArgumentList \"" + argumentList + "\"";
|
||||
} else {
|
||||
var base = "\"" + exe + "\"" + suffix;
|
||||
return "start \"\" " + base;
|
||||
return "echo Starting XPipe ...&start \"\" " + base;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,7 @@ import io.xpipe.app.core.AppProperties;
|
||||
import io.xpipe.app.core.AppRestart;
|
||||
import io.xpipe.app.core.mode.AppOperationMode;
|
||||
import io.xpipe.app.issue.ErrorEventFactory;
|
||||
import io.xpipe.app.process.CommandBuilder;
|
||||
import io.xpipe.app.process.LocalShell;
|
||||
import io.xpipe.app.process.ShellDialects;
|
||||
import io.xpipe.app.process.ShellScript;
|
||||
import io.xpipe.app.process.*;
|
||||
import io.xpipe.app.terminal.TerminalLaunch;
|
||||
import io.xpipe.app.util.Hyperlinks;
|
||||
|
||||
@@ -74,8 +71,11 @@ public class ChocoUpdater extends UpdateHandler {
|
||||
var powershellCommand = powershell
|
||||
? "powershell -Command " + sc.getShellDialect().quoteArgument(commandToRun)
|
||||
: "powershell -Command " + commandToRun;
|
||||
return ShellScript.lines(powershellCommand, AppRestart.getTerminalRestartCommand());
|
||||
});
|
||||
return ShellScript.lines(
|
||||
ShellDialects.isPowershell(sc) ? "echo \"Running choco command ...\"" : "echo Running choco command ...",
|
||||
powershellCommand,
|
||||
AppRestart.getTerminalRestartCommand());
|
||||
}).launch();
|
||||
});
|
||||
} catch (Throwable t) {
|
||||
ErrorEventFactory.fromThrowable(t).handle();
|
||||
@@ -89,7 +89,7 @@ public class ChocoUpdater extends UpdateHandler {
|
||||
|
||||
var chocoRelease = getOutdatedPackageUpdateVersion();
|
||||
// Use current release if the update is not available for choco yet
|
||||
if (chocoRelease.isEmpty() || !chocoRelease.get().equals(rel.getTag())) {
|
||||
if (chocoRelease.isEmpty() || (!chocoRelease.get().equals(rel.getTag()) && !chocoRelease.get().equals(rel.getTag() + ".0"))) {
|
||||
rel = AppRelease.of(AppProperties.get().getVersion());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user