Add a parameter to disable configuration file automatic creation #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Why
In very specific cases, configuration files should not be created by the daemon before the server first startup as they have not been created during the installation process.
This new flag enables egg creators to specify (default true) if the file should be created or not when the daemon tries to parse it.
What it add
(This is just an example on the Vanilla Minecraft egg, this is not where I think the flag would be useful)
How
When the daemon tries to open the file to parse it, changing the function to Open instead of Touch makes it return an error instead of creating the file. If the error is "IsNotExist" and "create_file" is false just return without logging an error.
Config parser file open function edition :
Add the flag to the ConfigurationFile struct :
UnmarshalJSON function addition :