Skip to content

Commit c93ac3f

Browse files
chist3rMohamed Atef
andauthored
Fix generating multiple documentations (#293)
* Fix generating multiple documentations * fix styleci Co-authored-by: Mohamed Atef <mohamed.atef@dotnaat.com>
1 parent 39b5ba2 commit c93ac3f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/Generator.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,14 @@ protected function prepareDirectory(): self
113113
throw new L5SwaggerException('Documentation storage directory is not writable');
114114
}
115115

116-
// delete all existing documentation
117-
if (File::exists($this->docDir)) {
118-
File::deleteDirectory($this->docDir);
116+
if (! File::exists($this->docDir)) {
117+
File::makeDirectory($this->docDir);
119118
}
120119

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

125-
File::makeDirectory($this->docDir);
126-
127124
return $this;
128125
}
129126

0 commit comments

Comments
 (0)