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

Some default values must be uncommented in clicraft.conf even if they are unchanged #7

Open
mdaffin opened this issue Jun 26, 2012 · 2 comments
Labels

Comments

@mdaffin
Copy link
Contributor

mdaffin commented Jun 26, 2012

Currently if you want to change one of the options in clicraft.conf you have to also uncomment the default values for any other options it uses. eg, if you want to edit START_COMMAND you must also uncomment SERVER_JAR and SERVER_DIR for it to work.

Not doing so leads to minecraft not starting and no helpful error message is given to the user or even any indication that it has failed when running clicraft start and rc.d in archlinux reporting it has successfully started when it hasn't (though this is another issue).

I would expect clicraft.conf to be pass the default values to/set them before it is read so that there is no need to uncomment values that you haven't changed.

@DMBuce
Copy link
Owner

DMBuce commented Jun 28, 2012

This is a chicken-and-egg problem that I've grappled with a bit in commits 7d0ab41 and 63a1c6a.

The issue is that if you do things the other way and set the default values for options before reading in clicraft.conf, then for any option you change, you also need to uncomment all other options that use it. e.g. if you want to edit SERVER_DIR you must also uncomment SERVER_JAR, START_COMMAND, and DOWNLOAD_COMMAND.

I'm not sure what the best way to resolve this is.

@mdaffin
Copy link
Contributor Author

mdaffin commented Jun 29, 2012

I will have a look into this problem next week when I have a bit of time see if there is a better way to handle it. Though I haven't thought of one yet that wouldn't cause the problems you mentioned.

I think the worst case we should add a comment to clicraft.conf to tell users they must uncomment all linked variables or possibly leave them uncommented with the default values in the example. This way they know of the problem, or I think is a better situation, if they want to change the values then they will copy the example config and edit what they want without needing to worry about possible problems of not uncommenting the values that haven't changed.

DMBuce added a commit that referenced this issue Jun 29, 2012
As suggested by Michael Daffin in issue #7, uncomment the options in
clicraft.conf and add a warning so that users don't accidentally
set garbage options due to uninitialized default values.

Due to this change, `clicraft edit` also had to be modified to check
for changes instead of non-comments before creating a new file from
a template.

This is (hopefully) a stop-gap solution until a proper one can be
found.
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