client: fix base path location deduction when sourced

- Since these files are only ever sourced, deduction must be relative to
  `BASH_SOURCE` (or else realpath will break)

- Fixes client-side `plugins` completion
  * realpath breakage was introduced in #301
This commit is contained in:
2026-02-18 17:53:04 -08:00
parent f7ca987da3
commit 9683bf8750
2 changed files with 2 additions and 2 deletions

View File

@@ -90,7 +90,7 @@ function lib_env::env()
# Environment location
# NOTE: keep aligned with gen.bash
local _env_dir
_env_dir="$(dirname "$(realpath -s $0)" | rev | cut -d'/' -f3- | rev)/conf.d/${global_tag_dir}/env"
_env_dir="$(dirname $(realpath -s "$BASH_SOURCE" | rev | cut -d'/' -f6- | rev))/conf.d/${global_tag_dir}/env"
local _env_file="${_env_dir}/${global_conf_filename}"
# shellcheck source=/dev/null