mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-07-01 04:21:11 +12:00
Fix update issues
This commit is contained in:
parent
e56c159e0e
commit
fbc56f0b81
|
@ -4,10 +4,10 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
import io.xpipe.app.core.AppProperties;
|
import io.xpipe.app.core.AppProperties;
|
||||||
|
import io.xpipe.app.util.LocalShell;
|
||||||
import io.xpipe.app.util.ScriptHelper;
|
import io.xpipe.app.util.ScriptHelper;
|
||||||
import io.xpipe.app.util.TerminalLauncher;
|
import io.xpipe.app.util.TerminalLauncher;
|
||||||
import io.xpipe.core.process.OsType;
|
import io.xpipe.core.process.OsType;
|
||||||
import io.xpipe.core.process.ShellDialects;
|
|
||||||
import io.xpipe.core.store.FileNames;
|
import io.xpipe.core.store.FileNames;
|
||||||
import io.xpipe.core.store.LocalStore;
|
import io.xpipe.core.store.LocalStore;
|
||||||
import io.xpipe.core.util.XPipeInstallation;
|
import io.xpipe.core.util.XPipeInstallation;
|
||||||
|
@ -93,11 +93,7 @@ public class AppInstaller {
|
||||||
@Override
|
@Override
|
||||||
public void installLocal(String file) throws Exception {
|
public void installLocal(String file) throws Exception {
|
||||||
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
||||||
var command = new LocalStore()
|
var command = String.format("""
|
||||||
.control()
|
|
||||||
.subShell(ShellDialects.BASH)
|
|
||||||
.command(String.format(
|
|
||||||
"""
|
|
||||||
function exec {
|
function exec {
|
||||||
echo "+ sudo apt install \\"%s\\""
|
echo "+ sudo apt install \\"%s\\""
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt-get install -qy "%s" || return 1
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install -qy "%s" || return 1
|
||||||
|
@ -106,9 +102,8 @@ public class AppInstaller {
|
||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
exec || read -rsp "Update failed ..."$'\\n' -n 1 key
|
exec || read -rsp "Update failed ..."$'\\n' -n 1 key
|
||||||
""",
|
""", file, file, name);
|
||||||
file, file, name));
|
TerminalLauncher.openDirect("XPipe Updater", LocalShell.getShell(), command);
|
||||||
TerminalLauncher.open("XPipe Updater", command);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -122,11 +117,7 @@ public class AppInstaller {
|
||||||
@Override
|
@Override
|
||||||
public void installLocal(String file) throws Exception {
|
public void installLocal(String file) throws Exception {
|
||||||
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
||||||
var command = new LocalStore()
|
var command = String.format("""
|
||||||
.control()
|
|
||||||
.subShell(ShellDialects.BASH)
|
|
||||||
.command(String.format(
|
|
||||||
"""
|
|
||||||
function exec {
|
function exec {
|
||||||
echo "+ sudo rpm -U -v --force \\"%s\\""
|
echo "+ sudo rpm -U -v --force \\"%s\\""
|
||||||
sudo rpm -U -v --force "%s" || return 1
|
sudo rpm -U -v --force "%s" || return 1
|
||||||
|
@ -135,9 +126,8 @@ public class AppInstaller {
|
||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
exec || read -rsp "Update failed ..."$'\\n' -n 1 key
|
exec || read -rsp "Update failed ..."$'\\n' -n 1 key
|
||||||
""",
|
""", file, file, name);
|
||||||
file, file, name));
|
TerminalLauncher.openDirect("XPipe Updater", LocalShell.getShell(), command);
|
||||||
TerminalLauncher.open("XPipe Updater", command);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -151,10 +141,7 @@ public class AppInstaller {
|
||||||
@Override
|
@Override
|
||||||
public void installLocal(String file) throws Exception {
|
public void installLocal(String file) throws Exception {
|
||||||
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
var name = AppProperties.get().isStaging() ? "xpipe-ptb" : "xpipe";
|
||||||
var command = new LocalStore()
|
var command = String.format("""
|
||||||
.control()
|
|
||||||
.command(String.format(
|
|
||||||
"""
|
|
||||||
function exec {
|
function exec {
|
||||||
echo "+ sudo installer -verboseR -allowUntrusted -pkg \\"%s\\" -target /"
|
echo "+ sudo installer -verboseR -allowUntrusted -pkg \\"%s\\" -target /"
|
||||||
sudo installer -verboseR -allowUntrusted -pkg "%s" -target / || return 1
|
sudo installer -verboseR -allowUntrusted -pkg "%s" -target / || return 1
|
||||||
|
@ -163,9 +150,8 @@ public class AppInstaller {
|
||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
exec || echo "Update failed ..." && read -rs -k 1 key
|
exec || echo "Update failed ..." && read -rs -k 1 key
|
||||||
""",
|
""", file, file, name);
|
||||||
file, file, name));
|
TerminalLauncher.openDirect("XPipe Updater", LocalShell.getShell(), command);
|
||||||
TerminalLauncher.open("XPipe Updater", command);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue