Skip to content

Commit

Permalink
Fix format of command to restore PostreSQL db (#3849)
Browse files Browse the repository at this point in the history
  • Loading branch information
LOBsTerr authored and jmolivas committed Apr 22, 2018
1 parent 73139e3 commit b5daec5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Command/Database/RestoreCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
if (strpos($file, '.sql.gz') !== false) {
$catCommand = "gunzip -c %s | ";
$catCommand = 'gunzip -c %s | ';
} else {
$catCommand = "cat %s | ";
$catCommand = 'cat %s | ';
}
if ($databaseConnection['driver'] == 'mysql') {
$command = sprintf(
Expand All @@ -93,7 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
);
} elseif ($databaseConnection['driver'] == 'pgsql') {
$command = sprintf(
'PGPASSWORD="%s" ' . $catCommand . 'psql -w -U %s -h %s -p %s -d %s',
$catCommand . 'PGPASSWORD="%s" psql -w -U %s -h %s -p %s -d %s',
$file,
$databaseConnection['password'],
$databaseConnection['username'],
Expand Down

0 comments on commit b5daec5

Please sign in to comment.