From ac6828d2b93696a6f5fd519487e07380ee4b1f9e Mon Sep 17 00:00:00 2001 From: Balaji Dharma Date: Mon, 12 Feb 2024 09:56:08 -0500 Subject: [PATCH] prevent doc genration when generate_always is false --- src/Console/GenerateDocsCommand.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Console/GenerateDocsCommand.php b/src/Console/GenerateDocsCommand.php index 2af91c5..772f666 100644 --- a/src/Console/GenerateDocsCommand.php +++ b/src/Console/GenerateDocsCommand.php @@ -3,6 +3,7 @@ namespace L5Swagger\Console; use Illuminate\Console\Command; +use L5Swagger\ConfigFactory; use L5Swagger\Exceptions\L5SwaggerException; use L5Swagger\GeneratorFactory; @@ -68,6 +69,15 @@ private function generateDocumentation(GeneratorFactory $generatorFactory, strin { $this->info('Regenerating docs '.$documentation); + $configFactory = resolve(ConfigFactory::class); + $config = $configFactory->documentationConfig($documentation); + + if (! $config['generate_always']) { + $this->info('Config generate_always false - skipping doc generation'); + + return; + } + $generator = $generatorFactory->make($documentation); $generator->generateDocs(); }