Skip to content

Commit

Permalink
feat Execute the dacapo command after dacapo:init (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucan-lab authored Feb 11, 2022
1 parent 92fc674 commit c09bab8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/Dacapo/Presentation/Console/DacapoInitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class DacapoInitCommand extends Command
* @var string
*/
protected $signature = 'dacapo:init
{--no-clear : Do not execute the dacapo:clear command}
{--no-migrate : Do not migrate}
{--laravel6 : Laravel 6.x default schema}
{--laravel7 : Laravel 7.x default schema}
{--laravel8 : Laravel 8.x default schema}
Expand All @@ -41,10 +41,6 @@ public function handle(Filesystem $filesystem): void
$filesystem->makeDirectory($schemasPath);
}

if ($this->option('no-clear') === false) {
$this->call('dacapo:clear', ['--force' => true, '--all' => true]);
}

$version = 'laravel8';

if ($this->option('laravel8')) {
Expand All @@ -60,5 +56,6 @@ public function handle(Filesystem $filesystem): void
file_put_contents($to, file_get_contents($from));

$this->line('<fg=green>Generated:</> database/schemas/default.yml');
$this->call('dacapo', ['--no-migrate' => $this->option('no-migrate')]);
}
}
2 changes: 1 addition & 1 deletion tests/Application/UseCase/DacapoInitCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ final class DacapoInitCommandTest extends TestCase
public function testResolve(): void
{
$this->app->register(ConsoleServiceProvider::class);
$this->artisan('dacapo:init')->assertExitCode(0);
$this->artisan('dacapo:init', ['--no-migrate' => true])->assertExitCode(0);
}
}
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract class TestCase extends OrchestraTestCase
* Call artisan command and return code.
*
* @param string $command
* @param array<string> $parameters
* @param array<string, mixed> $parameters
* @return PendingCommand
*/
public function artisan($command, $parameters = []): PendingCommand
Expand Down

0 comments on commit c09bab8

Please sign in to comment.