]> BookStack Code Mirror - system-cli/commitdiff
Fixed additional backup path issue
authorDan Brown <redacted>
Fri, 28 Apr 2023 18:11:09 +0000 (19:11 +0100)
committerDan Brown <redacted>
Fri, 28 Apr 2023 18:11:09 +0000 (19:11 +0100)
Also added extra message output before zip->close otherwise it would
look like theme backups could take a while.

src/Commands/BackupCommand.php

index a35ecb4985b82c1f9c2be61c033020a71bc8b67b..6a0871752866aabd465fd184f09c16405792a2c9 100644 (file)
@@ -74,6 +74,7 @@ final class BackupCommand extends Command
             $this->addFolderToZipRecursive($zip, Paths::join($appDir, 'themes'), 'themes');
         }
 
+        $output->writeln("<info>Saving backup archive...</info>");
         // 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))) {