This commit is contained in:
crschnick
2025-06-09 02:33:13 +00:00
parent 5f013d5409
commit 9f45186103
296 changed files with 2634 additions and 2247 deletions
@@ -97,8 +97,8 @@ public class CommandBuilder {
public CommandBuilder addQuotedKeyValue(String key, String value) {
return add(sc -> {
var v = sc.getShellDialect().quoteArgument(value);
return key + "=" + v;
var v = sc.getShellDialect().quoteArgument(value);
return key + "=" + v;
});
}
@@ -68,8 +68,8 @@ public interface OsType {
return profile;
}
var name = pc.executeSimpleStringCommand(
pc.getShellDialect().getPrintEnvironmentVariableCommand("USERNAME"));
var name =
pc.executeSimpleStringCommand(pc.getShellDialect().getPrintEnvironmentVariableCommand("USERNAME"));
if (!name.isEmpty()) {
return "C:\\Users\\" + name;
}
@@ -45,13 +45,11 @@ public class ProcessOutputException extends Exception {
var errorSuffix = hasMessage ? ":\n" + combinedError : "";
var message =
switch ((int) exitCode) {
case CommandControl
.START_FAILED_EXIT_CODE -> "Process did not start up properly and had to be killed"
+ errorSuffix;
case CommandControl.START_FAILED_EXIT_CODE ->
"Process did not start up properly and had to be killed" + errorSuffix;
case CommandControl.EXIT_TIMEOUT_EXIT_CODE -> "Wait for process exit timed out" + errorSuffix;
case CommandControl
.UNASSIGNED_EXIT_CODE -> "Process exited with unknown state. Did an external process interfere?"
+ errorSuffix;
case CommandControl.UNASSIGNED_EXIT_CODE ->
"Process exited with unknown state. Did an external process interfere?" + errorSuffix;
case CommandControl.INTERNAL_ERROR_EXIT_CODE -> "Process execution failed" + errorSuffix;
case CommandControl.ELEVATION_FAILED_EXIT_CODE -> "Process elevation failed" + errorSuffix;
default -> "Process returned exit code " + exitCode + errorSuffix;
@@ -14,10 +14,12 @@ public interface ShellDialectAskpass {
UUID requestId,
ElevationHandler handler,
CountDown countDown,
String message, String user, CommandConfiguration command
)
String message,
String user,
CommandConfiguration command)
throws Exception;
String elevateTerminalCommandWithPreparedAskpass(
ShellControl shellControl, ElevationHandler handler, String command, String prefix, String user) throws Exception;
ShellControl shellControl, ElevationHandler handler, String command, String prefix, String user)
throws Exception;
}
@@ -26,5 +26,4 @@ public interface ShellDumbMode {
default void prepareDumbExit(ShellControl shellControl) throws IOException {
shellControl.writeLine(" exit");
}
}
@@ -3,7 +3,6 @@ package io.xpipe.core.store;
import lombok.NonNull;
import lombok.Setter;
import lombok.Value;
import lombok.With;
import lombok.experimental.NonFinal;
import java.time.Instant;
@@ -2,7 +2,6 @@ package io.xpipe.core.store;
import io.xpipe.core.process.OsType;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
import java.nio.file.Path;
@@ -212,7 +211,7 @@ public final class FilePath {
}
var ar = value.split("[\\\\/]");
var l = Arrays.stream(ar).filter(s -> !s.isEmpty()).toList();
var l = Arrays.stream(ar).filter(s -> !s.isEmpty()).toList();
split = l;
return l;
}