diff --git a/src/StarterKits/Exporter.php b/src/StarterKits/Exporter.php index 472b9b934b..67b0718ac2 100644 --- a/src/StarterKits/Exporter.php +++ b/src/StarterKits/Exporter.php @@ -49,6 +49,7 @@ public function export(): void $this ->validateExportPath() ->validateConfig() + ->validatePackage() ->instantiateModules() ->clearExportPath() ->exportModules() @@ -81,6 +82,22 @@ protected function validateConfig(): self return $this; } + /** + * Validate package folder, if it exists. + */ + protected function validatePackage(): self + { + if (! $this->files->exists(base_path('package'))) { + return $this; + } + + if (! $this->files->exists(base_path('package/composer.json'))) { + throw new StarterKitException('Package config [package/composer.json] does not exist.'); + } + + return $this; + } + /** * Instantiate and validate modules that are to be installed. */