Rework state and license checks

This commit is contained in:
crschnick
2024-11-24 14:29:08 +00:00
parent 51288823e6
commit b18f44eaf5
27 changed files with 102 additions and 84 deletions

View File

@@ -1,6 +0,0 @@
package io.xpipe.core.process;
public interface OsNameState {
String getOsName();
}

View File

@@ -56,10 +56,10 @@ public interface ShellControl extends ProcessControl {
String getOsName();
boolean isLicenseCheck();
ReentrantLock getLock();
void requireLicensedFeature(String id);
ShellDialect getOriginalShellDialect();
void setOriginalShellDialect(ShellDialect dialect);

View File

@@ -14,7 +14,7 @@ import lombok.extern.jackson.Jacksonized;
@EqualsAndHashCode(callSuper = true)
@SuperBuilder(toBuilder = true)
@Jacksonized
public class ShellStoreState extends DataStoreState implements OsNameState {
public class ShellStoreState extends DataStoreState implements SystemState {
OsType.Any osType;
String osName;

View File

@@ -6,6 +6,11 @@ public class StubShellControl extends WrapperShellControl {
super(parent);
}
@Override
public boolean canHaveSubshells() {
return parent.canHaveSubshells();
}
@Override
public void close() throws Exception {}
}

View File

@@ -0,0 +1,12 @@
package io.xpipe.core.process;
public interface SystemState {
OsType getOsType();
String getOsName();
ShellDialect getShellDialect();
ShellTtyState getTtyState();
}

View File

@@ -112,13 +112,13 @@ public class WrapperShellControl implements ShellControl {
}
@Override
public boolean isLicenseCheck() {
return parent.isLicenseCheck();
public ReentrantLock getLock() {
return parent.getLock();
}
@Override
public ReentrantLock getLock() {
return parent.getLock();
public void requireLicensedFeature(String id) {
parent.requireLicensedFeature(id);
}
@Override