mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Detect webtop
This commit is contained in:
parent
092c270c5d
commit
36f47c24af
2 changed files with 10 additions and 3 deletions
|
@ -13,8 +13,8 @@ import java.time.Instant;
|
||||||
|
|
||||||
public class PortableUpdater extends UpdateHandler {
|
public class PortableUpdater extends UpdateHandler {
|
||||||
|
|
||||||
public PortableUpdater() {
|
public PortableUpdater(boolean thread) {
|
||||||
super(true);
|
super(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,15 +12,18 @@ import io.xpipe.core.util.XPipeInstallation;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public enum XPipeDistributionType {
|
public enum XPipeDistributionType {
|
||||||
UNKNOWN("unknown", false, () -> new GitHubUpdater(false)),
|
UNKNOWN("unknown", false, () -> new GitHubUpdater(false)),
|
||||||
DEVELOPMENT("development", true, () -> new GitHubUpdater(false)),
|
DEVELOPMENT("development", true, () -> new GitHubUpdater(false)),
|
||||||
PORTABLE("portable", false, () -> new PortableUpdater()),
|
PORTABLE("portable", false, () -> new PortableUpdater(true)),
|
||||||
NATIVE_INSTALLATION("install", true, () -> new GitHubUpdater(true)),
|
NATIVE_INSTALLATION("install", true, () -> new GitHubUpdater(true)),
|
||||||
HOMEBREW("homebrew", true, () -> new HomebrewUpdater()),
|
HOMEBREW("homebrew", true, () -> new HomebrewUpdater()),
|
||||||
|
WEBTOP("webtop", true, () -> new PortableUpdater(false)),
|
||||||
CHOCO("choco", true, () -> new ChocoUpdater());
|
CHOCO("choco", true, () -> new ChocoUpdater());
|
||||||
|
|
||||||
private static XPipeDistributionType type;
|
private static XPipeDistributionType type;
|
||||||
|
@ -95,6 +98,10 @@ public enum XPipeDistributionType {
|
||||||
return UNKNOWN;
|
return UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OsType.getLocal() == OsType.LINUX && "/config".equals(System.getProperty("user.home")) && Files.isDirectory(Path.of("/kclient"))) {
|
||||||
|
return WEBTOP;
|
||||||
|
}
|
||||||
|
|
||||||
try (var sc = LocalShell.getShell()) {
|
try (var sc = LocalShell.getShell()) {
|
||||||
// In theory, we can also add && !AppProperties.get().isStaging() here, but we want to replicate the
|
// In theory, we can also add && !AppProperties.get().isStaging() here, but we want to replicate the
|
||||||
// production behavior
|
// production behavior
|
||||||
|
|
Loading…
Reference in a new issue