Skip to content

Commit

Permalink
JobRunner::remote prepends / to arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 17, 2021
1 parent e922e1b commit 34243a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Deployment/JobRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ public function remote(string $command): array
{
if (preg_match('#^(mkdir|rmdir|unlink|mv)\s+(\S+)(?:\s+(\S+))?()$#', $command, $m)) {
[, $cmd, $a, $b] = $m;
$a = '/' . ltrim($a, '/');
if ($cmd === 'mkdir') {
$this->server->createDir($a);
} elseif ($cmd === 'rmdir') {
$this->server->removeDir($a);
} elseif ($cmd === 'unlink') {
$this->server->removeFile($a);
} elseif ($cmd === 'mv') {
$b = '/' . ltrim($b, '/');
$this->server->renameFile($a, $b);
}
return [null, null];
Expand Down

0 comments on commit 34243a3

Please sign in to comment.