File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 10
10
namespace SymfonyDocsBuilder ;
11
11
12
12
use Doctrine \RST \Configuration ;
13
+ use Symfony \Component \Filesystem \Filesystem ;
13
14
use Symfony \Component \Finder \Finder ;
14
15
15
16
class BuildConfig
@@ -161,6 +162,7 @@ public function setSubdirectoryToBuild(string $contentSubDir): self
161
162
162
163
public function setOutputDir (string $ outputDir ): self
163
164
{
165
+ (new Filesystem ())->mkdir ($ outputDir );
164
166
if (!file_exists ($ outputDir )) {
165
167
throw new \InvalidArgumentException (sprintf ('Doc builder output directory "%s" does not exist ' , $ outputDir ));
166
168
}
@@ -172,6 +174,7 @@ public function setOutputDir(string $outputDir): self
172
174
173
175
public function setCacheDir (string $ cacheDir ): self
174
176
{
177
+ (new Filesystem ())->mkdir ($ cacheDir );
175
178
if (!file_exists ($ cacheDir )) {
176
179
throw new \InvalidArgumentException (sprintf ('Doc builder cache directory "%s" does not exist ' , $ cacheDir ));
177
180
}
@@ -187,6 +190,7 @@ public function setCacheDir(string $cacheDir): self
187
190
*/
188
191
public function setImagesDir (string $ imagesDir ): self
189
192
{
193
+ (new Filesystem ())->mkdir ($ imagesDir );
190
194
if (!file_exists ($ imagesDir )) {
191
195
throw new \InvalidArgumentException (sprintf ('Doc builder images directory "%s" does not exist ' , $ imagesDir ));
192
196
}
Original file line number Diff line number Diff line change @@ -54,13 +54,13 @@ public function testBuildDocsDefault()
54
54
55
55
public function testBuildDocsForPdf ()
56
56
{
57
+ $ buildConfig = $ this ->createBuildConfig ();
58
+
57
59
$ fs = new Filesystem ();
58
60
if ($ fs ->exists ($ buildConfig ->getOutputDir ())) {
59
61
$ fs ->remove ($ buildConfig ->getOutputDir ());
60
62
}
61
63
$ fs ->mkdir ($ buildConfig ->getOutputDir ());
62
-
63
- $ buildConfig = $ this ->createBuildConfig ();
64
64
65
65
$ output = $ this ->executeCommand (
66
66
$ buildConfig ,
You can’t perform that action at this time.
0 commit comments