Skip to content

Commit

Permalink
Automatically run migration when --database is given.
Browse files Browse the repository at this point in the history
fixes #345

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Jun 14, 2024
1 parent d48c6b6 commit c7a856a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$composer = $this->findComposer();
$phpBinary = $this->phpBinary();

$commands = [
$commands = array_filter([
$composer." create-project laravel/laravel \"$directory\" $version --remove-vcs --prefer-dist --no-scripts",
$composer." run post-root-package-install -d \"$directory\"",
$phpBinary." \"$directory/artisan\" key:generate --ansi",
];
]);

if ($directory != '.' && $input->getOption('force')) {
if (PHP_OS_FAMILY == 'Windows') {
Expand Down Expand Up @@ -492,7 +492,7 @@ protected function promptForDatabaseOptions(string $directory, InputInterface $i
);
}

return [$input->getOption('database') ?? $defaultDatabase, $migrate ?? false];
return [$input->getOption('database') ?? $defaultDatabase, $migrate ?? $input->hasOption('database')];
}

/**
Expand Down

0 comments on commit c7a856a

Please sign in to comment.