From 06a3d6c9b2d652c8491db72cf8632690d029af1a Mon Sep 17 00:00:00 2001 From: Owen Date: Sat, 2 Sep 2017 10:35:15 +0100 Subject: [PATCH] added ability to create folders from stubs --- src/StubsManager.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/StubsManager.php b/src/StubsManager.php index 13d6e22..b891312 100644 --- a/src/StubsManager.php +++ b/src/StubsManager.php @@ -89,6 +89,10 @@ public function convertStubs($forceOverwrite = false) $newContent = str_replace($this->stub['placeholder'], $this->getName(), $stubContent); + if (!file_exists($this->stub['output_path'])) { + mkdir($this->stub['output_path'], 0755, true); + } + if (!file_put_contents($outputFile, $newContent)) { throw new Exception('Could not write to ' . $outputFile); }