generators gix
This commit is contained in:
@@ -27,6 +27,12 @@ class GenerateCollectionSchema extends Command
|
|||||||
|
|
||||||
$json = json_encode($schema, JSON_PRETTY_PRINT);
|
$json = json_encode($schema, JSON_PRETTY_PRINT);
|
||||||
$configDir = base_path(config('lucent.schemas_path'));
|
$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';
|
$schemaPath = $configDir . "/" . $name . '.json';
|
||||||
|
|
||||||
if(file_exists($schemaPath)){
|
if(file_exists($schemaPath)){
|
||||||
|
|||||||
@@ -28,8 +28,15 @@ class GenerateFileSchema extends Command
|
|||||||
|
|
||||||
$json = json_encode($schema, JSON_PRETTY_PRINT);
|
$json = json_encode($schema, JSON_PRETTY_PRINT);
|
||||||
$configDir = base_path(config('lucent.schemas_path'));
|
$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';
|
$schemaPath = $configDir . "/" . $name . '.json';
|
||||||
|
|
||||||
|
|
||||||
if (file_exists($schemaPath)) {
|
if (file_exists($schemaPath)) {
|
||||||
$this->error("The schema file already exists.");
|
$this->error("The schema file already exists.");
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user