From fdf4fdfb6ab7e83a684d1a674669a8a86898a1f9 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Tue, 26 Nov 2019 19:32:16 +0100 Subject: [PATCH] fix sqlite installer (#1283) --- src/Command/CreateReleaseCommand.php | 5 ----- src/Command/InstallCommand.php | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Command/CreateReleaseCommand.php b/src/Command/CreateReleaseCommand.php index d2401cbd..dd574c90 100644 --- a/src/Command/CreateReleaseCommand.php +++ b/src/Command/CreateReleaseCommand.php @@ -103,15 +103,12 @@ class CreateReleaseCommand extends Command $io->success('Prepare new packages for Kimai ' . $version . ' in ' . $tmpDir); $gitCmd = sprintf(self::CLONE_CMD, $version); - $tar = 'kimai-release-' . $version; $zip = 'kimai-release-' . $version; if ($version === Constants::VERSION && Constants::STATUS !== 'stable') { - $tar .= '_' . Constants::STATUS; $zip .= '_' . Constants::STATUS; } - $tar .= '.tar.gz'; $zip .= '.zip'; $prefix = 'APP_ENV=prod DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite'; @@ -147,7 +144,6 @@ class CreateReleaseCommand extends Command } $commands = array_merge($commands, [ - // 'Create tar' => 'cd ' . $tmpDir . ' && tar -czf ' . $directory . '/' . $tar . ' .', 'Create release zip' => 'cd ' . $tmpDir . ' && zip -q -r ' . $directory . '/' . $zip . ' .', 'Remove tmp directory' => 'rm -rf ' . $tmpDir, ]); @@ -166,7 +162,6 @@ class CreateReleaseCommand extends Command $io->success( 'New release package available at: ' . PHP_EOL . - // $directory . '/' . $tar . PHP_EOL . $directory . '/' . $zip ); diff --git a/src/Command/InstallCommand.php b/src/Command/InstallCommand.php index 7ffc4de2..25ae1fcf 100644 --- a/src/Command/InstallCommand.php +++ b/src/Command/InstallCommand.php @@ -146,8 +146,13 @@ final class InstallCommand extends Command throw new \Exception('Skipped database creation, aborting installation'); } + $options = []; + if ($this->connection->getDatabasePlatform()->getName() !== 'sqlite') { + $options = ['--if-not-exists' => true]; + } + $command = $this->getApplication()->find('doctrine:database:create'); - $result = $command->run(new ArrayInput(['--if-not-exists' => true]), $output); + $result = $command->run(new ArrayInput($options), $output); if (0 !== $result) { throw new \Exception('Failed creating database. Check your credentials in DATABASE_URL');