Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for split config files, "include" #111

Open
richteer opened this issue Sep 25, 2018 · 0 comments
Open

Add support for split config files, "include" #111

richteer opened this issue Sep 25, 2018 · 0 comments

Comments

@richteer
Copy link
Contributor

The main config.json should be able to include other config files on initial parse. This would allow:

  • large module configs to be self-contained
  • easier sharing of example configs
  • easier config templating -- cp template.json module_instance.json

On the other hand, it would make config editing by hand a bit more tedious, since now configs will be split up from one central location. Also, writing back to configs will have to be overhauled slightly to support this, and not stomp over the include directive.

Suggestion on how to implement:

As a key:

{
   "include": "foo:bar.json"
}

would resolve to:

{
    "foo":{...bar.json...}
}

As a value:

{
    "foo":"include:bar.json"
}

would resolve to:

{
    "foo":{...bar.json...}
}

The former is easiest to implement, and probably the cleanest. However, the latter may be needed in the event a config blob needs to be loaded as part of a list, e.g. "foo": ["include:bar.json", "include:baz.json"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant