generators gix

This commit is contained in:
2024-10-04 19:26:19 +03:00
parent 174a119c2e
commit e06e1db671
2 changed files with 13 additions and 0 deletions
@@ -27,6 +27,12 @@ class GenerateCollectionSchema extends Command
$json = json_encode($schema, JSON_PRETTY_PRINT);
$configDir = base_path(config('lucent.schemas_path'));
if(!file_exists($configDir)) {
$this->error("Your config directory \"$configDir\" doesn't exist. Create it first and run again");
return;
}
$schemaPath = $configDir . "/" . $name . '.json';
if(file_exists($schemaPath)){
+7
View File
@@ -28,8 +28,15 @@ class GenerateFileSchema extends Command
$json = json_encode($schema, JSON_PRETTY_PRINT);
$configDir = base_path(config('lucent.schemas_path'));
if(!file_exists($configDir)) {
$this->error("Your config directory \"$configDir\" doesn't exist. Create it first and run again");
return;
}
$schemaPath = $configDir . "/" . $name . '.json';
if (file_exists($schemaPath)) {
$this->error("The schema file already exists.");
return 0;