File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1010namespace SymfonyDocsBuilder ;
1111
1212use Doctrine \RST \Configuration ;
13+ use Symfony \Component \Filesystem \Filesystem ;
1314use Symfony \Component \Finder \Finder ;
1415
1516class BuildConfig
@@ -161,6 +162,7 @@ public function setSubdirectoryToBuild(string $contentSubDir): self
161162
162163 public function setOutputDir (string $ outputDir ): self
163164 {
165+ (new Filesystem ())->mkdir ($ outputDir );
164166 if (!file_exists ($ outputDir )) {
165167 throw new \InvalidArgumentException (sprintf ('Doc builder output directory "%s" does not exist ' , $ outputDir ));
166168 }
@@ -172,6 +174,7 @@ public function setOutputDir(string $outputDir): self
172174
173175 public function setCacheDir (string $ cacheDir ): self
174176 {
177+ (new Filesystem ())->mkdir ($ cacheDir );
175178 if (!file_exists ($ cacheDir )) {
176179 throw new \InvalidArgumentException (sprintf ('Doc builder cache directory "%s" does not exist ' , $ cacheDir ));
177180 }
@@ -187,6 +190,7 @@ public function setCacheDir(string $cacheDir): self
187190 */
188191 public function setImagesDir (string $ imagesDir ): self
189192 {
193+ (new Filesystem ())->mkdir ($ imagesDir );
190194 if (!file_exists ($ imagesDir )) {
191195 throw new \InvalidArgumentException (sprintf ('Doc builder images directory "%s" does not exist ' , $ imagesDir ));
192196 }
Original file line number Diff line number Diff line change @@ -54,13 +54,13 @@ public function testBuildDocsDefault()
5454
5555 public function testBuildDocsForPdf ()
5656 {
57+ $ buildConfig = $ this ->createBuildConfig ();
58+
5759 $ fs = new Filesystem ();
5860 if ($ fs ->exists ($ buildConfig ->getOutputDir ())) {
5961 $ fs ->remove ($ buildConfig ->getOutputDir ());
6062 }
6163 $ fs ->mkdir ($ buildConfig ->getOutputDir ());
62-
63- $ buildConfig = $ this ->createBuildConfig ();
6464
6565 $ output = $ this ->executeCommand (
6666 $ buildConfig ,
You can’t perform that action at this time.
0 commit comments