From 98bf021db9cc0b28c37796b1c127bb9c37068961 Mon Sep 17 00:00:00 2001 From: aarondill Date: Wed, 5 Jul 2023 14:02:26 -0500 Subject: [PATCH] handle slashes at end of _bin_dir *usually*, $PATH will *not* contain trailing slashes, while _bin_dir may or may not. This changes the case statement to test for `_bin_dir`, `_bin_dir/`, and `_bin_dir` without a trailing slash. This reduces false positives and unnecessary logs --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index c0c1338..1e3de47 100755 --- a/install.sh +++ b/install.sh @@ -175,7 +175,9 @@ main() { log "" log "zoxide is installed!" case ":${PATH}:" in - *":${_bin_dir}:"*) true ;; # noop + *":${_bin_dir}:"*) true ;; # noop + *":${_bin_dir%/}:"*) true ;; # noop + *":${_bin_dir}/:"*) true ;; # noop *) log "NOTE: ${_bin_dir} is not on your \$PATH. zoxide will not work unless it is added to \$PATH." ;; esac }