Skip to content

Commit

Permalink
prevent doc genration when generate_always is false
Browse files Browse the repository at this point in the history
  • Loading branch information
balajidharma authored Feb 12, 2024
1 parent 96fcc40 commit ac6828d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Console/GenerateDocsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace L5Swagger\Console;

use Illuminate\Console\Command;
use L5Swagger\ConfigFactory;
use L5Swagger\Exceptions\L5SwaggerException;
use L5Swagger\GeneratorFactory;

Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit ac6828d

Please sign in to comment.