Cleanup up the restore command and sort the input files
This commit is contained in:
parent
3920ed4244
commit
0b6b48d5ec
@ -40,10 +40,11 @@ class RestoreDatabaseCommand extends Command
|
||||
if (!$fileName){
|
||||
$finder = new Finder();
|
||||
$finder->in(__DIR__ . '/../..');
|
||||
$files = [sprintf('%s_backup.sql', $db)];
|
||||
$files = [];
|
||||
foreach ($finder->files()->name('*_backup.sql') as $file) {
|
||||
$files[] = $file->getFilename();
|
||||
}
|
||||
sort($files);
|
||||
$selectQuestion = new ChoiceQuestion('Backup name (*_backup.sql): ', $files);
|
||||
$fileName = $question->ask($input, $output, $selectQuestion);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user