Skip to content

Commit

Permalink
CLI-1362: [push:db] mysqldump failure not surfaced
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Jul 18, 2024
1 parent 56d0139 commit b7a6181
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Command/CommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1692,10 +1692,10 @@ protected function createMySqlDumpOnLocal(string $dbHost, string $dbUser, string
$outputCallback('out', "Dumping MySQL database to $localFilepath on this machine");
}
if ($this->localMachineHelper->commandExists('pv')) {
$command = "MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | pv --rate --bytes | gzip -9 > $localFilepath";
$command = "bash -c \"set -o pipefail; MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | pv --rate --bytes | gzip -9 > $localFilepath\"";
} else {
$this->io->warning('Install `pv` to see progress bar');
$command = "MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | gzip -9 > $localFilepath";
$command = "bash -c \"set -o pipefail; MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | gzip -9 > $localFilepath\"";
}

$process = $this->localMachineHelper->executeFromCmd($command, $outputCallback, null, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
Expand Down

0 comments on commit b7a6181

Please sign in to comment.