]> BookStack Code Mirror - system-cli/blobdiff - src/Commands/BackupCommand.php
Started testing of backup command
[system-cli] / src / Commands / BackupCommand.php
index 7c3730a1b6a39678be6fd208b2d074ca6fea9c97..05d90c72bf3afc06ce6e35bac83319c0e776a940 100644 (file)
@@ -49,9 +49,12 @@ final class BackupCommand extends Command
         $zip = new ZipArchive();
         $zip->open($zipTempFile, ZipArchive::CREATE);
 
-        // Add default files (.env config file and this CLI)
+        // Add default files (.env config file and this CLI if existing)
         $zip->addFile($appDir . DIRECTORY_SEPARATOR . '.env', '.env');
-        $zip->addFile($appDir . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'run', 'run');
+        $cliPath = $appDir . DIRECTORY_SEPARATOR . 'bookstack-system-cli';
+        if (file_exists($cliPath)) {
+            $zip->addFile($cliPath, 'bookstack-system-cli');
+        }
 
         if ($handleDatabase) {
             $output->writeln("<info>Dumping the database via mysqldump...</info>");