Multiple fixes
* Implemented ScriptRunner with environment expansion and cleaner code. * Added ApiClient plugin (com.noccy.apiclient) * Renamed CHANGELOG.md to VERSIONS.md * Shuffled buildtools * Added first unittests
This commit is contained in:
@ -65,7 +65,7 @@ class DockerDbExportCommand extends Command
|
||||
$cmd = sprintf("mysqldump -u%s -p%s %s", $dbuser, $dbpass, $database);
|
||||
break;
|
||||
}
|
||||
$this->exportFromService($service, $cmd, $output);
|
||||
$this->exportFromService($service, $cmd, $output, $input->getOption("output"));
|
||||
} elseif ($dsn) {
|
||||
$url = parse_url($dsn);
|
||||
if (empty($url)) {
|
||||
@ -77,9 +77,13 @@ class DockerDbExportCommand extends Command
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
private function exportFromService(string $service, string $command, OutputInterface $output)
|
||||
private function exportFromService(string $service, string $command, OutputInterface $output, ?string $outfile=null)
|
||||
{
|
||||
$cmd = sprintf("docker-compose exec -T %s %s", $service, $command);
|
||||
if ($outfile) {
|
||||
$cmd .= " > ".escapeshellarg($outfile);
|
||||
}
|
||||
$output->writeln(sprintf("→ <info>%s</>", $cmd));
|
||||
passthru($cmd);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user