Skip to content

Commit

Permalink
Filter out empty rsync command arguments (#3686)
Browse files Browse the repository at this point in the history
Fixes #3683
  • Loading branch information
coreyworrell authored Sep 12, 2023
1 parent 266554d commit 0cf5d18
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Utility/Rsync.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ public function call(Host $host, $source, string $destination, array $config = [
if (!is_array($source)) {
$source = [$source];
}
$command = array_merge(['rsync', $flags], $options, $source, [$destination]);
$command = array_filter(
array_merge(['rsync', $flags], $options, $source, [$destination]),
function (string $value) {
return $value !== '';
},
);

$commandString = $command[0];
for ($i = 1; $i < count($command); $i++) {
Expand Down

0 comments on commit 0cf5d18

Please sign in to comment.