Skip to content

Commit

Permalink
Issue #718: use command -v instead of checking status via '$?'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Sep 11, 2024
1 parent 897ee35 commit 5daf994
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions init/bash.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ fi

__build_FPATH_for_zsh_ksh()
{
(compinit -C 2> /dev/null)
if [ "$?" != 0 ]; then

if ! (compinit -C 2> /dev/null) ; then
__zsh_fpath=$(unset FPATH; zsh -f -c 'echo $FPATH')
fi

Expand All @@ -39,8 +39,7 @@ if [ -n "${ZSH_VERSION+x}" ]; then
fi

if [ -n "${KSH_VERSION+x}" -o -n "${BASH_VERSION+x}" ]; then
type zsh > /dev/null 2>&1
if [ "$?" = 0 ]; then
if command -v zsh > /dev/null; then
__build_FPATH_for_zsh_ksh
else
export FPATH=$(@PKGV@/libexec/addto --append FPATH ${FPATH:-} @PKGV@/init/ksh_funcs)
Expand Down

0 comments on commit 5daf994

Please sign in to comment.