Add WindowsCMakeExecutor

This commit is contained in:
crazywhalecc
2025-12-11 14:24:59 +08:00
parent f6b47ad810
commit 6d292b4c54
4 changed files with 258 additions and 15 deletions

View File

@@ -45,23 +45,11 @@ class WindowsCmd extends Shell
logger()->debug('Running command with result: ' . $cmd);
}
$cmd = $this->getExecString($cmd);
$result = $this->passthru($cmd, $this->console_putput, $cmd, capture_output: true, throw_on_error: false, cwd: $this->cd);
$result = $this->passthru($cmd, $this->console_putput, $cmd, capture_output: true, throw_on_error: false, cwd: $this->cd, env: $this->env);
$out = explode("\n", $result['output']);
return [$result['code'], $out];
}
public function setEnv(array $env): static
{
// windows currently does not support setting environment variables
throw new SPCInternalException('Windows does not support setting environment variables in shell commands.');
}
public function appendEnv(array $env): static
{
// windows currently does not support appending environment variables
throw new SPCInternalException('Windows does not support appending environment variables in shell commands.');
}
public function getLastCommand(): string
{
return $this->last_cmd;