Skip to content

Commit

Permalink
Make start_lexical.sh symbolic-link friendly.
Browse files Browse the repository at this point in the history
  • Loading branch information
rubin55 committed Dec 16, 2024
1 parent ad94b13 commit b7d804f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bin/start_lexical.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit b7d804f

Please sign in to comment.