diff options
author | Erich Eckner <git@eckner.net> | 2018-11-23 08:27:46 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-11-23 08:27:46 +0100 |
commit | 5d17a36b6d5fd04d4b9ed555fdb39c0d1c8f3609 (patch) | |
tree | 15b61eb2cedc847c3983c7ea6003bb11a14a3122 /lib | |
parent | de2aac43eeee9102fad048642187eeb184256104 (diff) | |
download | builder-5d17a36b6d5fd04d4b9ed555fdb39c0d1c8f3609.tar.xz |
lib/load-configuration: do not set base_dir if it is already set
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/load-configuration | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/load-configuration b/lib/load-configuration index cf7575b..01f922d 100755 --- a/lib/load-configuration +++ b/lib/load-configuration @@ -22,12 +22,14 @@ else i_am_the_master=false fi -# dirty hack to get this stuff debugable from a bash -if [ "x${0##*/}" = "x-bash" ] || [ "x${0##*/}" = "xbash" ] || [ "x${0##*/}" = "xdash" ]; then - base_dir=$(pwd) - set +e -else - base_dir=$(printf '%s/..' "$(dirname "$(readlink -f "$0")")") +if [ -z "${base_dir}" ]; then + # dirty hack to get this stuff debugable from a bash + if [ "x${0##*/}" = "x-bash" ] || [ "x${0##*/}" = "xbash" ] || [ "x${0##*/}" = "xdash" ]; then + base_dir=$(pwd) + set +e + else + base_dir=$(printf '%s/..' "$(dirname "$(readlink -f "$0")")") + fi fi work_dir="${base_dir}/work" |