Skip to content

Commit

Permalink
fix: command db:pull using old syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jul 21, 2023
1 parent a8caca8 commit 52f78e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion App/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,10 @@ public function shortName()
* Execute command on remote via ssh
* @return void
*/
public function sshExec($ssh, $cmd)
public function sshExec($ssh, $cmd, $echo = false)
{
$cmd = str_replace("\n", " && ", $cmd);
if ($echo) $this->write($cmd);
$this->exec("ssh $ssh \"$cmd\"");
}

Expand Down
4 changes: 2 additions & 2 deletions App/Commands/DbPull.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ public function handle()
$this->write("Creating remote dump...");
$php = $this->option('php') ?: $this->getConfig('remotePHP') ?: 'php';
$this->sshExec($ssh, "cd $dir
$php RockShell/rock db-dump -f tmp.sql");
$php RockShell/rock db:dump -f tmp.sql", true);

$this->write("Copying dump to local...");
$this->exec("scp $ssh:$dir/$folder/tmp.sql {$wire->config->paths->root}/$folder/tmp.sql");

$this->write("Removing remote dump...");
$this->sshExec($ssh, "cd $dir && rm -rf $dir/$folder/tmp.sql");

$this->call("db-restore", [
$this->call("db:restore", [
'--y' => true,
'--file' => 'tmp.sql',
]);
Expand Down

0 comments on commit 52f78e4

Please sign in to comment.