This commit is contained in:
Jo Shields 2023-12-08 13:11:15 -05:00
parent deecc351cf
commit fc3bfe570b

View file

@ -66,20 +66,15 @@
source="${BASH_SOURCE[0]}" source="${BASH_SOURCE[0]}"
echo "*** DEBUG source=$source"
# resolve $source until the file is no longer a symlink # resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
echo "*** DEBUG scriptroot=$scriptroot"
source="$(readlink "$source")" source="$(readlink "$source")"
echo "*** DEBUG source=$source"
# if $source was a relative symlink, we need to resolve it relative to the path where the # if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located # symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source" [[ $source != /* ]] && source="$scriptroot/$source"
done done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
echo "*** DEBUG scriptroot=$scriptroot"
function print_help () { function print_help () {
sed -n '/^### /,/^$/p' "$source" | cut -b 5- sed -n '/^### /,/^$/p' "$source" | cut -b 5-
@ -99,8 +94,8 @@ function highlight () {
echo "${COLOR_CYAN}$FAILURE_PREFIX${1//${COLOR_RESET}/${COLOR_CYAN}}${COLOR_CLEAR}" echo "${COLOR_CYAN}$FAILURE_PREFIX${1//${COLOR_RESET}/${COLOR_CYAN}}${COLOR_CLEAR}"
} }
which realpath
installer_dir=$(realpath "$scriptroot/../") installer_dir=$(realpath "$scriptroot/../")
echo "*** DEBUG installer_dir=$installer_dir"
tmp_dir='' tmp_dir=''
vmr_dir='' vmr_dir=''