From: Dan Brown Date: Fri, 28 Apr 2023 18:11:09 +0000 (+0100) Subject: Fixed additional backup path issue X-Git-Url: http://source.bookstackapp.com/system-cli/commitdiff_plain/81f9cf937818e2be1b8b269d7ee1d2e30759293e?ds=sidebyside Fixed additional backup path issue Also added extra message output before zip->close otherwise it would look like theme backups could take a while. --- diff --git a/src/Commands/BackupCommand.php b/src/Commands/BackupCommand.php index a35ecb4..6a08717 100644 --- a/src/Commands/BackupCommand.php +++ b/src/Commands/BackupCommand.php @@ -74,6 +74,7 @@ final class BackupCommand extends Command $this->addFolderToZipRecursive($zip, Paths::join($appDir, 'themes'), 'themes'); } + $output->writeln("Saving backup archive..."); // Close off our zip and move it to the required location $zip->close(); // Delete our temporary DB dump file if exists. Must be done after zip close. @@ -109,11 +110,11 @@ final class BackupCommand extends Command */ protected function buildZipFilePath(string $suggestedOutPath, string $appDir): string { - $suggestedOutPath = Paths::resolve($suggestedOutPath); - $zipDir = Paths::join($appDir, 'backups'); + $zipDir = Paths::join($appDir, 'storage', 'backups'); $zipName = "bookstack-backup-" . date('Y-m-d-His') . '.zip'; if ($suggestedOutPath) { + $suggestedOutPath = Paths::resolve($suggestedOutPath); if (is_dir($suggestedOutPath)) { $zipDir = realpath($suggestedOutPath); } else if (is_dir(dirname($suggestedOutPath))) {