(Mostly) Fixed tGetParentPath.

This commit is contained in:
Scott Duensing 2019-06-26 21:12:14 -05:00
parent c3050750ea
commit 3e285e4737

View file

@ -35,6 +35,12 @@ tPURPLE=5
tCYAN=6
#
# Global variables used by Towel.
#
__tG__PARENTPATH="${BASH_SOURCE[0]}"
#
# Draws bold white text inside a colored box.
#
@ -231,8 +237,10 @@ function tGetParentPath() {
local __RESULT=$1
local __PARENTPATH=
tFindPath __PARENTPATH "${BASH_SOURCE[1]}"
__TOWELPATH="${__PARENTPATH}/`basename \"${BASH_SOURCE[1]}\"`"
# We have to initialize __tG__PARENTPATH before the calling script
# changes directories elsewhere. We set it on load.
tFindPath __PARENTPATH "${__tG__PARENTPATH}"
__TOWELPATH="${__PARENTPATH}/`basename \"${__tG__PARENTPATH}\"`"
eval $__RESULT=\${__PARENTPATH}
}