Skip to content

Commit

Permalink
Use command -v for environments where which isn't available (mori…
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse authored and pelya committed Mar 21, 2019
1 parent babc990 commit c95a79c
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions build-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,6 @@ check_md5sum ()
}

# Find if a given shell program is available.
# We need to take care of the fact that the 'which <foo>' command
# may return either an empty string (Linux) or something like
# "no <foo> in ..." (Darwin). Also, we need to redirect stderr
# to /dev/null for Cygwin
#
# $1: variable name
# $2: program name
Expand All @@ -283,14 +279,7 @@ check_md5sum ()
#
find_program ()
{
local PROG
PROG=`which $2 2>/dev/null`
if [ -n "$PROG" ] ; then
if pattern_match '^no ' "$PROG"; then
PROG=
fi
fi
eval $1="$PROG"
eval $1=`command -v $2`
}

prepare_download ()
Expand Down

0 comments on commit c95a79c

Please sign in to comment.