Closed orospakr closed 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
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.
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.
... and don't include the config file itself in the repo, but include an example instead.
Makes merging much less annoying.