X-Git-Url: http://source.bookstackapp.com/system-cli/blobdiff_plain/2757341bb5ad7ccdebf6296480adeb1efc0f8137..0248e2c0d91d7dab5bb7d4da26b9a558b5497be1:/src/Commands/BackupCommand.php diff --git a/src/Commands/BackupCommand.php b/src/Commands/BackupCommand.php index 7e47d4a..05d90c7 100644 --- a/src/Commands/BackupCommand.php +++ b/src/Commands/BackupCommand.php @@ -1,4 +1,4 @@ -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("Dumping the database via mysqldump...");