endofzero / Minecraft-Sheller

Shell script designed to allow for automation of Minecraft Server Administration.
62 stars 18 forks source link

Place config in a separate file from code #33

Closed orospakr closed 13 years ago

orospakr commented 13 years ago

... and don't include the config file itself in the repo, but include an example instead.

Makes merging much less annoying.

jdiamond commented 13 years ago

Or keep the existing config where it is, but look for an optional file that can executed to "overwrite" those values. I think it could be as easy as something like this:

[ -f config.sh ] && source config.sh
endofzero commented 13 years ago

That works, if a config.sh file is located, that is honored above the default configs, otherwise it will just use the configuration at the top of the file. I also added an echo denoting that an alt config is in use for clarity. Let me know if you feel this should be removed.

endofzero commented 13 years ago

Added an additional variable "CONFIG_PATH" before the configuration setting. This is to set the location of config.sh for inclusion. This was done to fix an issue I was experiencing that the script would look in the current directory for config.sh. Since I have the script set up as an alias, it would only read the config if it existed in the folder I was in.