mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-12-01 01:04:00 +00:00
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() {
|
check_bin_dir() {
|
||||||
bin_dir="$1"
|
bin_dir="${1%/}"
|
||||||
|
|
||||||
if [ ! -d "$BIN_DIR" ]; then
|
if [ ! -d "$BIN_DIR" ]; then
|
||||||
error "Installation location $BIN_DIR does not appear to be a directory"
|
error "Installation location $BIN_DIR does not appear to be a directory"
|
||||||
@ -276,7 +276,7 @@ check_bin_dir() {
|
|||||||
good=$(
|
good=$(
|
||||||
IFS=:
|
IFS=:
|
||||||
for path in $PATH; do
|
for path in $PATH; do
|
||||||
if [ "${path}" = "${bin_dir}" ]; then
|
if [ "${path%/}" = "${bin_dir}" ]; then
|
||||||
printf 1
|
printf 1
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user