diff --git a/src/Commands/BuildToolsBase.php b/src/Commands/BuildToolsBase.php index 7f871551..f15e1903 100644 --- a/src/Commands/BuildToolsBase.php +++ b/src/Commands/BuildToolsBase.php @@ -657,8 +657,12 @@ protected function runCommandTemplateOnRemoteEnv( // Set the target environment to sftp mode prior to running the command $this->connectionSet($env, 'sftp'); + foreach ($options as $key => $val) { + if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) { + $metadata[$key] = $this->escapeArgument($val); + } + } foreach ((array)$command_templates as $command_template) { - $metadata = array_map(function ($item) { return $this->escapeArgument($item); }, $options); $command_line = $this->interpolate($command_template, $metadata); $redacted_metadata = $this->redactMetadata($metadata, ['account-pass']); $redacted_command_line = $this->interpolate($command_template, $redacted_metadata);