From bd68fe9f9729382f157e9e8b09ae46ad2042d85e Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Fri, 22 Nov 2024 15:03:06 -0500 Subject: [PATCH] fix: do not prepend `$PATH` in `this_hipo.sh` if `bin/` is not installed --- meson/this_hipo.sh.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson/this_hipo.sh.in b/meson/this_hipo.sh.in index 97a4cd8..aa28e7e 100644 --- a/meson/this_hipo.sh.in +++ b/meson/this_hipo.sh.in @@ -7,6 +7,7 @@ # workaround older versions of macOS not having `realpath` get_realpath() { + [ ! -d "$1" ] && echo "ERROR: path '$1' does not exist; this should never happen, please contact the maintainers" >&2 echo $(cd $1 && pwd -P) } @@ -18,7 +19,9 @@ export PKG_CONFIG_PATH=$HIPO/@libdir@/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_ # prepend to PATH hipo_path=$(pkg-config --variable bindir hipo4) -[ -n "${hipo_path-}" ] && export PATH=$(get_realpath $hipo_path)${PATH:+:${PATH}} +if [ -n "${hipo_path-}" ]; then + [ -d "$hipo_path" ] && export PATH=$(get_realpath $hipo_path)${PATH:+:${PATH}} +fi unset hipo_path # prepend to @ld_path@