Skip to content

Commit 936c4d8

Browse files
committed
Change env string inject order
1 parent 1c1f7b1 commit 936c4d8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/SPC/util/UnixShell.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ public function exec(string $cmd): UnixShell
4545
/* @phpstan-ignore-next-line */
4646
logger()->info(ConsoleColor::yellow('[EXEC] ') . ConsoleColor::green($cmd));
4747
logger()->debug('Executed at: ' . debug_backtrace()[0]['file'] . ':' . debug_backtrace()[0]['line']);
48+
$env_str = $this->getEnvString();
49+
if (!empty($env_str)) {
50+
$cmd = "{$env_str} {$cmd}";
51+
}
4852
if ($this->cd !== null) {
4953
$cmd = 'cd ' . escapeshellarg($this->cd) . ' && ' . $cmd;
5054
}
5155
if (!$this->debug) {
5256
$cmd .= ' 1>/dev/null 2>&1';
5357
}
54-
$env_str = $this->getEnvString();
55-
if (!empty($env_str)) {
56-
$env_str = "{$env_str} ";
57-
}
58-
f_passthru("{$env_str}{$cmd}");
58+
f_passthru($cmd);
5959
return $this;
6060
}
6161

0 commit comments

Comments
 (0)