Fix: restore cd and stderr redirect for platform-images shell_exec

Got reverted during earlier merge conflict resolution. Without cd,
node can't find modules. Without stderr redirect, log lines corrupt
the JSON output causing json_decode to fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-03-15 10:19:31 -07:00
parent 4c5d8b07dc
commit 6ec5f812e1

View file

@ -190,7 +190,7 @@ JSEOF;
file_put_contents($scriptPath, $script);
}
$output = shell_exec("PLAYWRIGHT_BROWSERS_PATH=/opt/playwright/browsers /usr/bin/node $scriptPath " . escapeshellarg($platformUrl) . " " . escapeshellarg($tempFile) . " 2>&1");
$output = shell_exec("cd /opt/playwright && PLAYWRIGHT_BROWSERS_PATH=/opt/playwright/browsers /usr/bin/node $scriptPath " . escapeshellarg($platformUrl) . " " . escapeshellarg($tempFile) . " 2>/tmp/platform-images-stderr.log");
@unlink($tempFile);
$result = json_decode(trim($output ?? ''), true);