From 9683bf8750ae5408bea6d646bffcbd5bef65950b Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Wed, 18 Feb 2026 17:53:04 -0800 Subject: [PATCH] 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 --- client/conf.d/client/env/gen.bash | 2 +- client/src/docker/lib/internal/lib_env.bash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/conf.d/client/env/gen.bash b/client/conf.d/client/env/gen.bash index 12f39bb..0fa68b0 100644 --- a/client/conf.d/client/env/gen.bash +++ b/client/conf.d/client/env/gen.bash @@ -67,7 +67,7 @@ fi # Client-specific environment, including bind mounts (client view) if [ -z "$global_client_base_path" ]; then - global_client_base_path="$(dirname "$(realpath -s $0)" | rev | cut -d'/' -f3- | rev)" + global_client_base_path="$(dirname $(realpath -s "$BASH_SOURCE" | rev | cut -d'/' -f6- | rev))" fi if [ -z "$DOCKER_FINANCE_CLIENT_CONF" ]; then diff --git a/client/src/docker/lib/internal/lib_env.bash b/client/src/docker/lib/internal/lib_env.bash index 56a0ddc..be7b348 100644 --- a/client/src/docker/lib/internal/lib_env.bash +++ b/client/src/docker/lib/internal/lib_env.bash @@ -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