diff --git a/bin/start_lexical.sh b/bin/start_lexical.sh index 4b29a39ba..fa5d77da0 100755 --- a/bin/start_lexical.sh +++ b/bin/start_lexical.sh @@ -1,7 +1,16 @@ #!/usr/bin/env bash set -o pipefail -script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" +# find script file, even if we're a link pointing to it +script_file=${BASH_SOURCE[0]} +while [ -L "$script_file" ]; do + script_dir=$(cd -P "$( dirname "$script_file" )" >/dev/null 2>&1 && pwd) + script_file=$(readlink "$script_file") + [[ $script_file != /* ]] && script_file=$script_dir/$script_file +done + +# set script_dir to parent dir of script_file +script_dir=$(cd -P "$( dirname "$script_file" )" >/dev/null 2>&1 && pwd) # shellcheck disable=SC1091 if ! . "$script_dir"/activate_version_manager.sh; then