fix: Use -L to check for symlinks in conditional expressions (#12457)

This avoids conflicting with a somewhat common global `-h` alias
recommended by [`bat`](https://github.com/sharkdp/bat?tab=readme-ov-file#highlighting---help-messages)

Fixes #12457
This commit is contained in:
Clay Caviness 2024-07-06 12:10:08 -04:00
commit 572dcdab46
3 changed files with 6 additions and 6 deletions

View file

@ -20,7 +20,7 @@ _source-from-homebrew() {
local _brew_prefix
# check default brew prefix
if [[ -h /usr/local/opt/chruby ]];then
if [[ -L /usr/local/opt/chruby ]];then
_brew_prefix="/usr/local/opt/chruby"
else
# ok , it is not default prefix

View file

@ -18,7 +18,7 @@ function _rbfu_rubies_print() {
rb_out="$rb"
# If the ruby is a symlink, add @ to the name.
if [[ -h "$1" ]]; then
if [[ -L "$1" ]]; then
rb_out="${rb_out}${fg[green]}@${reset_color}"
fi