Skip to content

Commit

Permalink
Fix generating multiple documentations (#293)
Browse files Browse the repository at this point in the history
* Fix generating multiple documentations

* fix styleci

Co-authored-by: Mohamed Atef <mohamed.atef@dotnaat.com>
  • Loading branch information
chist3r and Mohamed Atef authored Jul 13, 2020
1 parent 39b5ba2 commit c93ac3f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,14 @@ protected function prepareDirectory(): self
throw new L5SwaggerException('Documentation storage directory is not writable');
}

// delete all existing documentation
if (File::exists($this->docDir)) {
File::deleteDirectory($this->docDir);
if (! File::exists($this->docDir)) {
File::makeDirectory($this->docDir);
}

if (File::exists($this->docDir)) {
throw new L5SwaggerException('Documentation storage directory or files could not be deleted');
if (! File::exists($this->docDir)) {
throw new L5SwaggerException('Documentation storage directory could not be created');
}

File::makeDirectory($this->docDir);

return $this;
}

Expand Down

0 comments on commit c93ac3f

Please sign in to comment.