From 275e13d8766d689de825a57aabf73cfb2a7b79b0 Mon Sep 17 00:00:00 2001 From: Samgu Lee Date: Sat, 4 Jan 2025 18:26:02 +0900 Subject: [PATCH] Revise a message for migrations (#81) --- src/Command/GenerateMigrationsCommand.php | 5 ++--- src/Laravel/Commands/GenerateMigrationsCommand.php | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Command/GenerateMigrationsCommand.php b/src/Command/GenerateMigrationsCommand.php index b8cbf8c..e6d2230 100644 --- a/src/Command/GenerateMigrationsCommand.php +++ b/src/Command/GenerateMigrationsCommand.php @@ -4,7 +4,6 @@ use Cable8mm\Xeed\Generators\MigrationGenerator; use Cable8mm\Xeed\Mergers\MergerContainer; -use Cable8mm\Xeed\Support\Path; use Cable8mm\Xeed\Xeed; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; @@ -68,9 +67,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int MergerContainer::getEngines() )->run(force: $force); - $output->writeln(''.Path::migration().DIRECTORY_SEPARATOR.$table->migration().' has been generated.'.''); + $output->writeln('A migration file for '.$table.' table has been generated.'); } catch (\RuntimeException $e) { - $output->writeln(''.Path::migration().DIRECTORY_SEPARATOR.$table->migration().'.php file already exists.'.''); + $output->writeln(''.$e->getMessage().''); } } diff --git a/src/Laravel/Commands/GenerateMigrationsCommand.php b/src/Laravel/Commands/GenerateMigrationsCommand.php index b63af00..8112c9e 100644 --- a/src/Laravel/Commands/GenerateMigrationsCommand.php +++ b/src/Laravel/Commands/GenerateMigrationsCommand.php @@ -52,9 +52,9 @@ public function handle(Xeed $xeed) MergerContainer::getEngines() )->run(force: $force); - $this->info(database_path('migrations').DIRECTORY_SEPARATOR.$table->factory().'.php has been generated.'); + $this->info('A migration file for '.$table.' table has been generated.'); } catch (\Exception $e) { - $this->error(database_path('migrations').DIRECTORY_SEPARATOR.$table->factory().'.php file already exists.'); + $this->error($e->getMessage()); } }