fix sqlite installer (#1283)

This commit is contained in:
Kevin Papst
2019-11-26 19:32:16 +01:00
committed by GitHub
parent 5ee0396a02
commit fdf4fdfb6a
2 changed files with 6 additions and 6 deletions

View File

@@ -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
);

View File

@@ -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');