Skip to content

Commit

Permalink
added ability to create folders from stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenMelbz committed Sep 2, 2017
1 parent 9c1b12c commit 06a3d6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/StubsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 06a3d6c

Please sign in to comment.