From a85f65473d6f11be504e48299c449b16150f2511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Rom=C3=A1n?= Date: Thu, 10 Mar 2022 09:40:33 -0800 Subject: [PATCH] refactor(install): remove trailing slash from `BIN_DIR` (#3723) The installation script warns about `BIN_DIR` not being found in `$PATH` when the users pass a trailing forward slash. This has been discussed in #1310, #1341, and #3486. Fixes #3493 --- install/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/install.sh b/install/install.sh index 77df24aa5..6936ba7ba 100755 --- a/install/install.sh +++ b/install/install.sh @@ -263,7 +263,7 @@ confirm() { } check_bin_dir() { - bin_dir="$1" + bin_dir="${1%/}" if [ ! -d "$BIN_DIR" ]; then error "Installation location $BIN_DIR does not appear to be a directory" @@ -276,7 +276,7 @@ check_bin_dir() { good=$( IFS=: for path in $PATH; do - if [ "${path}" = "${bin_dir}" ]; then + if [ "${path%/}" = "${bin_dir}" ]; then printf 1 break fi