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
This commit is contained in:
parent
43006910c5
commit
a85f65473d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue