Added support for ~/.sit per user config file.

This commit is contained in:
Christoph Niethammer 2012-05-11 08:02:14 +00:00
parent 393868777a
commit ecb84751f8
2 changed files with 8 additions and 0 deletions

3
README
View file

@ -23,6 +23,9 @@ It includes a variety of default values:
* DEFAULT_PLATFORM * DEFAULT_PLATFORM
* DEFAULT_COMPILER * DEFAULT_COMPILER
A user specific configuration file $HOME/.sit" can be used to overwrite the
settings in the global configuration file.
The installation process is currently controled with the following environment The installation process is currently controled with the following environment
variables: variables:
* COMPILER * COMPILER

5
sit
View file

@ -10,7 +10,12 @@ set -e
SIT_PATH=$(dirname $PWD/$0) SIT_PATH=$(dirname $PWD/$0)
SIT_CONFIG_FILE=$SIT_PATH/etc/sit.conf SIT_CONFIG_FILE=$SIT_PATH/etc/sit.conf
SIT_USER_CONFIG_FILE=$HOME/.sit
# Reading in user configuration file if it exists
if [[ -e $SIT_USER_CONFIG_FILE ]] ; then
source $SIT_USER_CONFIG_FILE
fi
# Reading in global configuration file # Reading in global configuration file
if [[ -e $SIT_CONFIG_FILE ]] ; then if [[ -e $SIT_CONFIG_FILE ]] ; then
source $SIT_CONFIG_FILE source $SIT_CONFIG_FILE