Skip to content

Commit

Permalink
Replace "which" with "command -v"
Browse files Browse the repository at this point in the history
Since the latter is at least semi-POSIX compliant:

http://pubs.opengroup.org/onlinepubs/009696899/utilities/command.html

Avoids the need for certbot#1486
  • Loading branch information
pde committed Nov 13, 2015
1 parent 153022c commit 3551ffb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bootstrap/_deb_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ apt-get install -y --no-install-recommends \
libffi-dev \
ca-certificates \

if ! which virtualenv > /dev/null ; then
if ! command -v virtualenv > /dev/null ; then
echo Failed to install a working \"virtualenv\" command, exiting
exit 1
fi
6 changes: 3 additions & 3 deletions letsencrypt-auto
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ ExperimentalBootstrap() {
}

DeterminePythonVersion() {
if which python2 > /dev/null ; then
if command -v python2 > /dev/null ; then
export LE_PYTHON=${LE_PYTHON:-python2}
elif which python2.7 > /dev/null ; then
elif command -v python2.7 > /dev/null ; then
export LE_PYTHON=${LE_PYTHON:-python2.7}
elif which python > /dev/null ; then
elif command -v python > /dev/null ; then
export LE_PYTHON=${LE_PYTHON:-python}
else
echo "Cannot find any Pythons... please install one!"
Expand Down

0 comments on commit 3551ffb

Please sign in to comment.