refactor(deployment): improve environment variable handling in ApplicationDeploymentJob

This commit is contained in:
Andras Bacsai 2025-09-26 15:17:42 +02:00
parent 320a7c97f9
commit d81ed86920

View file

@ -1332,8 +1332,8 @@ private function php_finetunes(&$parsed)
$variables = data_get($parsed, 'variables', []);
$envCommands = [];
foreach ($variables as $key => $value) {
$envCommands[] = "echo \"$key=\${$key}\" >> /app/.env";
foreach (array_keys($variables) as $key) {
$envCommands[] = "printf '%s=%s\\n' ".escapeshellarg($key)." \"\${$key}\" >> /app/.env";
}
if (! empty($envCommands)) {