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 a parameter to disable configuration file automatic creation #45

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

superdarki
Copy link

@superdarki superdarki commented Oct 9, 2024

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

{Server File Config}
(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 :
{AC38805D-4F4F-41D7-9B60-2084BE086CC4}
Add the flag to the ConfigurationFile struct :
{E02BC110-3581-4054-A64D-61F0EECFCCDB}
UnmarshalJSON function addition :
{67C5CD79-627D-4A2E-A03E-2724037B8D74}

@superdarki
Copy link
Author

I have a bug with my pelican install (docker related), I can't test if the IsNotExist error handling works.

@superdarki superdarki marked this pull request as ready for review October 10, 2024 12:28
@superdarki
Copy link
Author

Tested it and now it works, the error handling and the not creation of the file

@dshygfujsfgy
Copy link

UP

@gOOvER
Copy link

gOOvER commented Oct 21, 2024

UP

??

@QuintenQVD0
Copy link
Contributor

This now conflicts with this: #34

and is there anyone realy needing this?

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

Successfully merging this pull request may close these issues.

4 participants