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

How to supply a path to config file? #17

Closed
slestak opened this issue Dec 24, 2014 · 1 comment
Closed

How to supply a path to config file? #17

slestak opened this issue Dec 24, 2014 · 1 comment
Labels

Comments

@slestak
Copy link
Contributor

slestak commented Dec 24, 2014

I am not seeing how to create a Config object with an explicit path?

Sorry if this is an elementary question.

There is no Config constructor that accepts a path.

I see this project, that may be a response to this need.
https://github.com/splitice/JSONConfigHelpers.Net

Thoughts?

@Dynalon
Copy link
Owner

Dynalon commented Dec 26, 2014

You can merge any configuration object (like Config.Default or Config.User) via the ConfigObject.ApplyJsonFromPath() method:

// create merged instance
var merged = Config.ApplyJsonFromPath("/home/userxy/myconfig.json", Config.Default);

// if no config object is specified, you will get the bare config from the .json
var bare = Config.ApplyJsonFromPath("/home/userxy/myconfig.json");

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

No branches or pull requests

2 participants