Merge pull request #12984 from snipe/features/check_for_zip_in_backup_filename

Check that the filename we pass ends in zip, add it if not
This commit is contained in:
snipe 2023-05-08 12:43:34 -07:00 committed by GitHub
commit 4503815ad7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,14 @@ class SystemBackup extends Command
public function handle()
{
if ($this->option('filename')) {
$this->call('backup:run', ['--filename' => $this->option('filename')]);
$filename = $this->option('filename');
// Make sure the filename ends in .zip
if (!ends_with($filename, '.zip')) {
$filename = $filename.'.zip';
}
$this->call('backup:run', ['--filename' => $filename]);
} else {
$this->call('backup:run');
}