add env manager

This commit is contained in:
crazywhalecc
2024-04-07 15:52:24 +08:00
committed by Jerry Ma
parent 254844b5ec
commit bd8f91d466
24 changed files with 389 additions and 203 deletions

View File

@@ -62,7 +62,12 @@ class UnixShell
public function setEnv(array $env): UnixShell
{
$this->env = array_merge($this->env, $env);
foreach ($env as $k => $v) {
if ($v === '') {
continue;
}
$this->env[$k] = $v;
}
return $this;
}