Initialize config if it does not exist yet
parent
fa89ef75e4
commit
cf0753e062
|
@ -63,7 +63,11 @@ class JsonConfigSource implements ConfigSourceInterface
|
|||
array_shift($args);
|
||||
$fallback = array_pop($args);
|
||||
|
||||
if ($this->file->exists()) {
|
||||
$contents = file_get_contents($this->file->getPath());
|
||||
} else {
|
||||
$contents = "{\n \"config\": {\n }\n}\n";
|
||||
}
|
||||
$manipulator = new JsonManipulator($contents);
|
||||
|
||||
// try to update cleanly
|
||||
|
|
Loading…
Reference in New Issue