Enhance Windows support by updating artifact configuration and improving extraction logic

This commit is contained in:
crazywhalecc
2025-12-11 11:35:12 +08:00
parent dc05ad23c9
commit 2080407283
21 changed files with 382 additions and 181 deletions

View File

@@ -148,8 +148,12 @@ abstract class Shell
bool $console_output = false,
?string $original_command = null,
bool $capture_output = false,
bool $throw_on_error = true
bool $throw_on_error = true,
?string $cwd = null
): array {
if ($cwd !== null) {
$cwd = $cwd;
}
$file_res = null;
if ($this->enable_log_file) {
// write executed command to the log file using fwrite
@@ -160,10 +164,10 @@ abstract class Shell
}
$descriptors = [
0 => ['file', 'php://stdin', 'r'], // stdin
1 => ['pipe', 'w'], // stdout
2 => ['pipe', 'w'], // stderr
1 => PHP_OS_FAMILY === 'Windows' ? ['socket'] : ['pipe', 'w'], // stdout
2 => PHP_OS_FAMILY === 'Windows' ? ['socket'] : ['pipe', 'w'], // stderr
];
$process = proc_open($cmd, $descriptors, $pipes);
$process = proc_open($cmd, $descriptors, $pipes, $cwd);
$output_value = '';
try {