mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Fixed --overwrite option of the backup command not working
This fixes issue #635
This commit is contained in:
parent
b7b941e3a1
commit
6f91ff1f28
1 changed files with 4 additions and 1 deletions
|
@ -52,6 +52,7 @@ class BackupCommand extends Command
|
||||||
$backup_attachments = $input->getOption('attachments');
|
$backup_attachments = $input->getOption('attachments');
|
||||||
$backup_config = $input->getOption('config');
|
$backup_config = $input->getOption('config');
|
||||||
$backup_full = $input->getOption('full');
|
$backup_full = $input->getOption('full');
|
||||||
|
$overwrite = $input->getOption('overwrite');
|
||||||
|
|
||||||
if ($backup_full) {
|
if ($backup_full) {
|
||||||
$backup_database = true;
|
$backup_database = true;
|
||||||
|
@ -70,7 +71,9 @@ class BackupCommand extends Command
|
||||||
|
|
||||||
//Check if the file already exists
|
//Check if the file already exists
|
||||||
//Then ask the user, if he wants to overwrite the file
|
//Then ask the user, if he wants to overwrite the file
|
||||||
if (file_exists($output_filepath) && !$io->confirm('The file '.realpath($output_filepath).' already exists. Do you want to overwrite it?', false)) {
|
if (!$overwrite
|
||||||
|
&& file_exists($output_filepath)
|
||||||
|
&& !$io->confirm('The file '.realpath($output_filepath).' already exists. Do you want to overwrite it?', false)) {
|
||||||
$io->error('Backup aborted!');
|
$io->error('Backup aborted!');
|
||||||
return Command::FAILURE;
|
return Command::FAILURE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue