From 936c4d8696476f6463a19d6663d1daf74d5973e6 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Mon, 9 Jun 2025 12:12:22 +0800 Subject: [PATCH] Change env string inject order --- src/SPC/util/UnixShell.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SPC/util/UnixShell.php b/src/SPC/util/UnixShell.php index be80cb4c..a53f423d 100644 --- a/src/SPC/util/UnixShell.php +++ b/src/SPC/util/UnixShell.php @@ -45,17 +45,17 @@ class UnixShell /* @phpstan-ignore-next-line */ logger()->info(ConsoleColor::yellow('[EXEC] ') . ConsoleColor::green($cmd)); logger()->debug('Executed at: ' . debug_backtrace()[0]['file'] . ':' . debug_backtrace()[0]['line']); + $env_str = $this->getEnvString(); + if (!empty($env_str)) { + $cmd = "{$env_str} {$cmd}"; + } if ($this->cd !== null) { $cmd = 'cd ' . escapeshellarg($this->cd) . ' && ' . $cmd; } if (!$this->debug) { $cmd .= ' 1>/dev/null 2>&1'; } - $env_str = $this->getEnvString(); - if (!empty($env_str)) { - $env_str = "{$env_str} "; - } - f_passthru("{$env_str}{$cmd}"); + f_passthru($cmd); return $this; }