From 5bdf0feaadef903789101268f40ad717deae2bee Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Sat, 7 Dec 2019 22:13:46 +1300 Subject: [PATCH 1/7] WIP --- .../Generator/ControllerGeneratorTest.php | 20 ++++++++++++++--- .../Generator/FactoryGeneratorTest.php | 16 +++++++++++++- .../Generator/MigrationGeneratorTest.php | 20 +++++++++++++++++ .../Feature/Generator/ModelGeneratorTest.php | 18 +++++++++++++-- .../Feature/Generator/RouteGeneratorTest.php | 22 +++++++++++++++++-- 5 files changed, 88 insertions(+), 8 deletions(-) diff --git a/tests/Feature/Generator/ControllerGeneratorTest.php b/tests/Feature/Generator/ControllerGeneratorTest.php index f229182c..0ea2afc5 100644 --- a/tests/Feature/Generator/ControllerGeneratorTest.php +++ b/tests/Feature/Generator/ControllerGeneratorTest.php @@ -2,10 +2,10 @@ namespace Tests\Feature\Generators; +use Tests\TestCase; use Blueprint\Blueprint; -use Blueprint\Generators\ControllerGenerator; use Blueprint\Lexers\StatementLexer; -use Tests\TestCase; +use Blueprint\Generators\ControllerGenerator; /** * @see ControllerGenerator @@ -70,9 +70,23 @@ public function output_writes_migration_for_controller_tree($definition, $path, $tree = $this->blueprint->analyze($tokens); $this->assertEquals(['created' => [$path]], $this->subject->output($tree)); - ++$iteration; + $iteration++; } + /** + * @test + * @dataProvider controllerTreeDataProvider + */ + public function erase_deletes_controllers_listed_in_tree($definition, $path) + { + $this->files->expects('delete') + ->with($path); + + $tokens = $this->blueprint->parse($this->fixture($definition)); + $tree = $this->blueprint->analyze($tokens); + + $this->assertEquals(['deleted' => [$path]], $this->subject->erase($tree)); + } public function controllerTreeDataProvider() { diff --git a/tests/Feature/Generator/FactoryGeneratorTest.php b/tests/Feature/Generator/FactoryGeneratorTest.php index c0934b7f..f6d1a79a 100644 --- a/tests/Feature/Generator/FactoryGeneratorTest.php +++ b/tests/Feature/Generator/FactoryGeneratorTest.php @@ -60,6 +60,20 @@ public function output_writes_migration_for_model_tree($definition, $path, $migr $this->assertEquals(['created' => [$path]], $this->subject->output($tree)); } + /** + * @test + * @dataProvider modelTreeDataProvider + */ + public function erase_deletes_factories_listed_in_tree($definition, $path) + { + $this->files->expects('delete') + ->with($path); + + $tokens = $this->blueprint->parse($this->fixture($definition)); + $tree = $this->blueprint->analyze($tokens); + + $this->assertEquals(['deleted' => [$path]], $this->subject->erase($tree)); + } public function modelTreeDataProvider() { @@ -68,4 +82,4 @@ public function modelTreeDataProvider() ['definitions/team.bp', 'database/factories/TeamFactory.php', 'factories/team.php'] ]; } -} \ No newline at end of file +} diff --git a/tests/Feature/Generator/MigrationGeneratorTest.php b/tests/Feature/Generator/MigrationGeneratorTest.php index f6be4d92..137fa136 100644 --- a/tests/Feature/Generator/MigrationGeneratorTest.php +++ b/tests/Feature/Generator/MigrationGeneratorTest.php @@ -95,6 +95,26 @@ public function output_uses_past_timestamp_for_multiple_migrations() $this->assertEquals(['created' => [$post_path, $comment_path]], $this->subject->output($tree)); } + /** + * @test + * @dataProvider modelTreeDataProvider + */ + public function erase_deltes_migrations_listed_in_model_tree($definition, $path) + { + $now = Carbon::now(); + Carbon::setTestNow($now); + + $timestamp_path = str_replace('timestamp', $now->format('Y_m_d_His'), $path); + + $this->files->expects('delete') + ->with($timestamp_path); + + $tokens = $this->blueprint->parse($this->fixture($definition)); + $tree = $this->blueprint->analyze($tokens); + + $this->assertEquals(['deleted' => [$timestamp_path]], $this->subject->erase($tree)); + } + public function modelTreeDataProvider() { return [ diff --git a/tests/Feature/Generator/ModelGeneratorTest.php b/tests/Feature/Generator/ModelGeneratorTest.php index 70fee269..ed26ddf8 100644 --- a/tests/Feature/Generator/ModelGeneratorTest.php +++ b/tests/Feature/Generator/ModelGeneratorTest.php @@ -2,9 +2,9 @@ namespace Tests\Feature\Generators; +use Tests\TestCase; use Blueprint\Blueprint; use Blueprint\Generators\ModelGenerator; -use Tests\TestCase; class ModelGeneratorTest extends TestCase { @@ -81,9 +81,23 @@ public function output_writes_migration_for_model_tree($definition, $path, $mode $tree = $this->blueprint->analyze($tokens); $this->assertEquals(['created' => [$path]], $this->subject->output($tree)); - ++$iteration; + $iteration++; } + /** + * @test + * @dataProvider modelTreeDataProvider + */ + public function erase_deletes_models_listed_in_tree($definition, $path) + { + $this->files->expects('delete') + ->with($path); + + $tokens = $this->blueprint->parse($this->fixture($definition)); + $tree = $this->blueprint->analyze($tokens); + + $this->assertEquals(['deleted' => [$path]], $this->subject->erase($tree)); + } public function modelTreeDataProvider() { diff --git a/tests/Feature/Generator/RouteGeneratorTest.php b/tests/Feature/Generator/RouteGeneratorTest.php index 5deba954..6e227cdd 100644 --- a/tests/Feature/Generator/RouteGeneratorTest.php +++ b/tests/Feature/Generator/RouteGeneratorTest.php @@ -2,10 +2,10 @@ namespace Tests\Feature\Generators; +use Tests\TestCase; use Blueprint\Blueprint; -use Blueprint\Generators\RouteGenerator; use Blueprint\Lexers\StatementLexer; -use Tests\TestCase; +use Blueprint\Generators\RouteGenerator; /** * @see RouteGenerator @@ -57,6 +57,24 @@ public function output_writes_migration_for_route_tree($definition, $routes) $this->assertEquals(['updated' => [$path]], $this->subject->output($tree)); } + /** + * @test + * @dataProvider controllerTreeDataProvider + */ + public function erase_deletes_routes_in_tree($definition, $routes) + { + $path = 'routes/web.php'; + + $this->files->expects('get') + ->with($path); + $this->files->expects('put') + ->with($path, ''); + + $tokens = $this->blueprint->parse($this->fixture($definition)); + $tree = $this->blueprint->analyze($tokens); + + $this->assertEquals(['updated' => [$path]], $this->subject->erase($tree)); + } public function controllerTreeDataProvider() { From eaa9b1a63a4dbd6004997028a897832f8f9974ed Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Sat, 7 Dec 2019 22:14:04 +1300 Subject: [PATCH 2/7] WIP --- src/EraseCommand.php | 117 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 src/EraseCommand.php diff --git a/src/EraseCommand.php b/src/EraseCommand.php new file mode 100644 index 00000000..af0f0f80 --- /dev/null +++ b/src/EraseCommand.php @@ -0,0 +1,117 @@ +files = $files; + } + + /** + * Execute the console command. + * + * @return mixed + */ + public function handle() + { + $file = $this->argument('draft'); + if (!file_exists($file)) { + $this->error('Draft file could not be found: ' . $file); + } + + $contents = $this->files->get($file); + + $blueprint = new Blueprint(); + + $blueprint->registerLexer(new \Blueprint\Lexers\ModelLexer()); + $blueprint->registerLexer(new \Blueprint\Lexers\ControllerLexer(new \Blueprint\Lexers\StatementLexer())); + + $blueprint->registerGenerator(new \Blueprint\Generators\MigrationGenerator($this->files)); + $blueprint->registerGenerator(new \Blueprint\Generators\ModelGenerator($this->files)); + $blueprint->registerGenerator(new \Blueprint\Generators\FactoryGenerator($this->files)); + + $blueprint->registerGenerator(new \Blueprint\Generators\ControllerGenerator($this->files)); + $blueprint->registerGenerator(new \Blueprint\Generators\Statements\EventGenerator($this->files)); + $blueprint->registerGenerator(new \Blueprint\Generators\Statements\FormRequestGenerator($this->files)); + $blueprint->registerGenerator(new \Blueprint\Generators\Statements\JobGenerator($this->files)); + $blueprint->registerGenerator(new \Blueprint\Generators\Statements\MailGenerator($this->files)); + $blueprint->registerGenerator(new \Blueprint\Generators\Statements\ViewGenerator($this->files)); + $blueprint->registerGenerator(new \Blueprint\Generators\RouteGenerator($this->files)); + + $tokens = $blueprint->parse($contents); + $registry = $blueprint->analyze($tokens); + $generated = $blueprint->generate($registry); + + collect($generated)->each(function ($files, $action) { + $this->line(Str::studly($action) . ':', $this->outputStyle($action)); + collect($files)->each(function ($file) { + $this->line('- ' . $file); + }); + + $this->line(''); + }); + } + + /** + * Get the console command arguments. + * + * @return array + */ + protected function getArguments() + { + return [ + ['draft', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Which models to include', []], + ]; + } + + /** + * Get the console command options. + * + * @return array + */ + protected function getOptions() + { + return []; + } + + private function outputStyle($action) + { + if ($action === 'deleted') { + return 'error'; + } elseif ($action === 'updated') { + return 'comment'; + } + + return 'info'; + } +} From 6145c39a2e755148b79436e06f26fb2715461f8a Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Sat, 7 Dec 2019 22:38:59 +1300 Subject: [PATCH 3/7] add dump method --- src/Blueprint.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Blueprint.php b/src/Blueprint.php index ad3c50df..3713e623 100644 --- a/src/Blueprint.php +++ b/src/Blueprint.php @@ -2,10 +2,9 @@ namespace Blueprint; - -use Blueprint\Contracts\Generator; use Blueprint\Contracts\Lexer; use Symfony\Component\Yaml\Yaml; +use Blueprint\Contracts\Generator; class Blueprint { @@ -25,7 +24,7 @@ public function analyze(array $tokens) { $registry = [ 'models' => [], - 'controllers' => [] + 'controllers' => [], ]; foreach ($this->lexers as $lexer) { @@ -46,6 +45,11 @@ public function generate(array $tree): array return $components; } + public function dump(array $generated) + { + return Yaml::dump($generated); + } + public function registerLexer(Lexer $lexer) { $this->lexers[] = $lexer; @@ -55,4 +59,4 @@ public function registerGenerator(Generator $generator) { $this->generators[] = $generator; } -} \ No newline at end of file +} From 87f475e0795c7098828848153122ec0d0332bff6 Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Sat, 7 Dec 2019 22:39:14 +1300 Subject: [PATCH 4/7] preserve last build --- src/BlueprintCommand.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/BlueprintCommand.php b/src/BlueprintCommand.php index d5dc7f8a..f7aebdc3 100644 --- a/src/BlueprintCommand.php +++ b/src/BlueprintCommand.php @@ -2,9 +2,9 @@ namespace Blueprint; +use Illuminate\Support\Str; use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem; -use Illuminate\Support\Str; use Symfony\Component\Console\Input\InputArgument; class BlueprintCommand extends Command @@ -80,8 +80,12 @@ public function handle() $this->line(''); }); - } + $this->files->put( + '.last_build.yaml', + $blueprint->dump($generated) + ); + } /** * Get the console command arguments. From 7f9d690385c4e326f4a91c55c17571752ace7df8 Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Sat, 7 Dec 2019 22:51:39 +1300 Subject: [PATCH 5/7] add erase command --- src/BlueprintServiceProvider.php | 20 +++++++++++---- src/EraseCommand.php | 44 +++++++++++--------------------- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/src/BlueprintServiceProvider.php b/src/BlueprintServiceProvider.php index 772f18a1..dd2fad93 100644 --- a/src/BlueprintServiceProvider.php +++ b/src/BlueprintServiceProvider.php @@ -2,8 +2,8 @@ namespace Blueprint; -use Illuminate\Contracts\Support\DeferrableProvider; use Illuminate\Support\ServiceProvider; +use Illuminate\Contracts\Support\DeferrableProvider; class BlueprintServiceProvider extends ServiceProvider implements DeferrableProvider { @@ -32,8 +32,16 @@ function ($app) { return new BlueprintCommand($app['files']); } ); + $this->app->bind('command.blueprint.erase', + function ($app) { + return new EraseCommand($app['files']); + } + ); - $this->commands('command.blueprint.build'); + $this->commands([ + 'command.blueprint.build', + 'command.blueprint.erase', + ]); } /** @@ -43,7 +51,9 @@ function ($app) { */ public function provides() { - return ['command.blueprint.build']; + return [ + 'command.blueprint.build', + 'command.blueprint.erase', + ]; } - -} \ No newline at end of file +} diff --git a/src/EraseCommand.php b/src/EraseCommand.php index af0f0f80..9fcb9a1e 100644 --- a/src/EraseCommand.php +++ b/src/EraseCommand.php @@ -14,7 +14,7 @@ class EraseCommand extends Command * * @var string */ - protected $signature = 'blueprint:erase {draft=draft.yaml}'; + protected $signature = 'blueprint:erase'; /** * The console command description. @@ -44,36 +44,24 @@ public function __construct(Filesystem $files) */ public function handle() { - $file = $this->argument('draft'); - if (!file_exists($file)) { - $this->error('Draft file could not be found: ' . $file); - } - - $contents = $this->files->get($file); + $contents = $this->files->get('.last_build.yaml'); $blueprint = new Blueprint(); + $lastBuild = $blueprint->parse($contents); - $blueprint->registerLexer(new \Blueprint\Lexers\ModelLexer()); - $blueprint->registerLexer(new \Blueprint\Lexers\ControllerLexer(new \Blueprint\Lexers\StatementLexer())); - - $blueprint->registerGenerator(new \Blueprint\Generators\MigrationGenerator($this->files)); - $blueprint->registerGenerator(new \Blueprint\Generators\ModelGenerator($this->files)); - $blueprint->registerGenerator(new \Blueprint\Generators\FactoryGenerator($this->files)); + collect($lastBuild)->each(function ($files, $action) { + if ($action === 'created') { + $this->files->delete($files); + } - $blueprint->registerGenerator(new \Blueprint\Generators\ControllerGenerator($this->files)); - $blueprint->registerGenerator(new \Blueprint\Generators\Statements\EventGenerator($this->files)); - $blueprint->registerGenerator(new \Blueprint\Generators\Statements\FormRequestGenerator($this->files)); - $blueprint->registerGenerator(new \Blueprint\Generators\Statements\JobGenerator($this->files)); - $blueprint->registerGenerator(new \Blueprint\Generators\Statements\MailGenerator($this->files)); - $blueprint->registerGenerator(new \Blueprint\Generators\Statements\ViewGenerator($this->files)); - $blueprint->registerGenerator(new \Blueprint\Generators\RouteGenerator($this->files)); + $this->line(Str::studly($action) . ':', $this->outputStyle($action)); - $tokens = $blueprint->parse($contents); - $registry = $blueprint->analyze($tokens); - $generated = $blueprint->generate($registry); + if ($action === 'updated') { + $this->error( + 'Please check the following files which cannot be erased of previous changes automatically.', + ); + } - collect($generated)->each(function ($files, $action) { - $this->line(Str::studly($action) . ':', $this->outputStyle($action)); collect($files)->each(function ($file) { $this->line('- ' . $file); }); @@ -106,12 +94,10 @@ protected function getOptions() private function outputStyle($action) { - if ($action === 'deleted') { + if ($action === 'created') { return 'error'; - } elseif ($action === 'updated') { - return 'comment'; } - return 'info'; + return 'comment'; } } From 488523bb4ea584805e72cbe6994e4820b0c54972 Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Sat, 7 Dec 2019 22:53:40 +1300 Subject: [PATCH 6/7] revoke previous changes --- .../Generator/ControllerGeneratorTest.php | 15 -------------- .../Generator/FactoryGeneratorTest.php | 15 -------------- .../Generator/MigrationGeneratorTest.php | 20 ------------------- .../Feature/Generator/ModelGeneratorTest.php | 15 -------------- .../Feature/Generator/RouteGeneratorTest.php | 19 ------------------ 5 files changed, 84 deletions(-) diff --git a/tests/Feature/Generator/ControllerGeneratorTest.php b/tests/Feature/Generator/ControllerGeneratorTest.php index 0ea2afc5..db517062 100644 --- a/tests/Feature/Generator/ControllerGeneratorTest.php +++ b/tests/Feature/Generator/ControllerGeneratorTest.php @@ -73,21 +73,6 @@ public function output_writes_migration_for_controller_tree($definition, $path, $iteration++; } - /** - * @test - * @dataProvider controllerTreeDataProvider - */ - public function erase_deletes_controllers_listed_in_tree($definition, $path) - { - $this->files->expects('delete') - ->with($path); - - $tokens = $this->blueprint->parse($this->fixture($definition)); - $tree = $this->blueprint->analyze($tokens); - - $this->assertEquals(['deleted' => [$path]], $this->subject->erase($tree)); - } - public function controllerTreeDataProvider() { return [ diff --git a/tests/Feature/Generator/FactoryGeneratorTest.php b/tests/Feature/Generator/FactoryGeneratorTest.php index f6d1a79a..a59001fe 100644 --- a/tests/Feature/Generator/FactoryGeneratorTest.php +++ b/tests/Feature/Generator/FactoryGeneratorTest.php @@ -60,21 +60,6 @@ public function output_writes_migration_for_model_tree($definition, $path, $migr $this->assertEquals(['created' => [$path]], $this->subject->output($tree)); } - /** - * @test - * @dataProvider modelTreeDataProvider - */ - public function erase_deletes_factories_listed_in_tree($definition, $path) - { - $this->files->expects('delete') - ->with($path); - - $tokens = $this->blueprint->parse($this->fixture($definition)); - $tree = $this->blueprint->analyze($tokens); - - $this->assertEquals(['deleted' => [$path]], $this->subject->erase($tree)); - } - public function modelTreeDataProvider() { return [ diff --git a/tests/Feature/Generator/MigrationGeneratorTest.php b/tests/Feature/Generator/MigrationGeneratorTest.php index 137fa136..f6be4d92 100644 --- a/tests/Feature/Generator/MigrationGeneratorTest.php +++ b/tests/Feature/Generator/MigrationGeneratorTest.php @@ -95,26 +95,6 @@ public function output_uses_past_timestamp_for_multiple_migrations() $this->assertEquals(['created' => [$post_path, $comment_path]], $this->subject->output($tree)); } - /** - * @test - * @dataProvider modelTreeDataProvider - */ - public function erase_deltes_migrations_listed_in_model_tree($definition, $path) - { - $now = Carbon::now(); - Carbon::setTestNow($now); - - $timestamp_path = str_replace('timestamp', $now->format('Y_m_d_His'), $path); - - $this->files->expects('delete') - ->with($timestamp_path); - - $tokens = $this->blueprint->parse($this->fixture($definition)); - $tree = $this->blueprint->analyze($tokens); - - $this->assertEquals(['deleted' => [$timestamp_path]], $this->subject->erase($tree)); - } - public function modelTreeDataProvider() { return [ diff --git a/tests/Feature/Generator/ModelGeneratorTest.php b/tests/Feature/Generator/ModelGeneratorTest.php index ed26ddf8..063810c9 100644 --- a/tests/Feature/Generator/ModelGeneratorTest.php +++ b/tests/Feature/Generator/ModelGeneratorTest.php @@ -84,21 +84,6 @@ public function output_writes_migration_for_model_tree($definition, $path, $mode $iteration++; } - /** - * @test - * @dataProvider modelTreeDataProvider - */ - public function erase_deletes_models_listed_in_tree($definition, $path) - { - $this->files->expects('delete') - ->with($path); - - $tokens = $this->blueprint->parse($this->fixture($definition)); - $tree = $this->blueprint->analyze($tokens); - - $this->assertEquals(['deleted' => [$path]], $this->subject->erase($tree)); - } - public function modelTreeDataProvider() { return [ diff --git a/tests/Feature/Generator/RouteGeneratorTest.php b/tests/Feature/Generator/RouteGeneratorTest.php index 6e227cdd..064fdf85 100644 --- a/tests/Feature/Generator/RouteGeneratorTest.php +++ b/tests/Feature/Generator/RouteGeneratorTest.php @@ -57,25 +57,6 @@ public function output_writes_migration_for_route_tree($definition, $routes) $this->assertEquals(['updated' => [$path]], $this->subject->output($tree)); } - /** - * @test - * @dataProvider controllerTreeDataProvider - */ - public function erase_deletes_routes_in_tree($definition, $routes) - { - $path = 'routes/web.php'; - - $this->files->expects('get') - ->with($path); - $this->files->expects('put') - ->with($path, ''); - - $tokens = $this->blueprint->parse($this->fixture($definition)); - $tree = $this->blueprint->analyze($tokens); - - $this->assertEquals(['updated' => [$path]], $this->subject->erase($tree)); - } - public function controllerTreeDataProvider() { return [ From a88e53a5deefcc112c040bcbc10f60ad3823a06b Mon Sep 17 00:00:00 2001 From: Jason McCreary Date: Thu, 19 Dec 2019 16:50:24 -0600 Subject: [PATCH 7/7] Tweak erase command output --- src/BlueprintCommand.php | 2 +- src/BlueprintServiceProvider.php | 3 +-- src/EraseCommand.php | 19 +++++++------------ 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/BlueprintCommand.php b/src/BlueprintCommand.php index f7aebdc3..f36e01d3 100644 --- a/src/BlueprintCommand.php +++ b/src/BlueprintCommand.php @@ -82,7 +82,7 @@ public function handle() }); $this->files->put( - '.last_build.yaml', + '.blueprint', $blueprint->dump($generated) ); } diff --git a/src/BlueprintServiceProvider.php b/src/BlueprintServiceProvider.php index dd2fad93..35306d92 100644 --- a/src/BlueprintServiceProvider.php +++ b/src/BlueprintServiceProvider.php @@ -2,8 +2,8 @@ namespace Blueprint; -use Illuminate\Support\ServiceProvider; use Illuminate\Contracts\Support\DeferrableProvider; +use Illuminate\Support\ServiceProvider; class BlueprintServiceProvider extends ServiceProvider implements DeferrableProvider { @@ -14,7 +14,6 @@ class BlueprintServiceProvider extends ServiceProvider implements DeferrableProv */ public function boot() { - // ... if (!defined('STUBS_PATH')) { define('STUBS_PATH', dirname(__DIR__) . '/stubs'); } diff --git a/src/EraseCommand.php b/src/EraseCommand.php index 9fcb9a1e..fbf1d55d 100644 --- a/src/EraseCommand.php +++ b/src/EraseCommand.php @@ -21,7 +21,7 @@ class EraseCommand extends Command * * @var string */ - protected $description = 'Erase components created from a Blueprint draft'; + protected $description = 'Erase components created from last Blueprint build'; /** @var Filesystem $files */ protected $files; @@ -44,22 +44,17 @@ public function __construct(Filesystem $files) */ public function handle() { - $contents = $this->files->get('.last_build.yaml'); + $contents = $this->files->get('.blueprint'); $blueprint = new Blueprint(); - $lastBuild = $blueprint->parse($contents); + $generated = $blueprint->parse($contents); - collect($lastBuild)->each(function ($files, $action) { + collect($generated)->each(function ($files, $action) { if ($action === 'created') { + $this->line('Deleted:', $this->outputStyle($action)); $this->files->delete($files); - } - - $this->line(Str::studly($action) . ':', $this->outputStyle($action)); - - if ($action === 'updated') { - $this->error( - 'Please check the following files which cannot be erased of previous changes automatically.', - ); + } elseif ($action === 'updated') { + $this->comment('The updates to the following files can not be erased automatically.'); } collect($files)->each(function ($file) {