From 37b10c2050df6427d2b650b251373e665585672a Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Sun, 10 Nov 2024 23:32:25 -0500 Subject: [PATCH] Export whole modules folder. --- src/StarterKits/Exporter.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/StarterKits/Exporter.php b/src/StarterKits/Exporter.php index a62a54f996..ddbfa123f4 100644 --- a/src/StarterKits/Exporter.php +++ b/src/StarterKits/Exporter.php @@ -40,7 +40,8 @@ public function export(): void ->validateExportPath() ->validateConfig() ->instantiateModules() - ->exportModules() + ->exportInlineModules() + ->exportModulesFolder() ->exportConfig() ->exportHooks() ->exportComposerJson(); @@ -133,15 +134,25 @@ protected function normalizeModuleKey(string $key, string $childKey): string } /** - * Export all the modules. + * Export all inline modules. */ - protected function exportModules(): self + protected function exportInlineModules(): self { $this->modules->each(fn ($module) => $module->export($this->exportPath)); return $this; } + /** + * Export modules folder. + */ + protected function exportModulesFolder(): self + { + $this->files->copyDirectory(base_path('modules'), "{$this->exportPath}/modules"); + + return $this; + } + /** * Get starter kit config. */