Skip to content

Commit

Permalink
pre-commit-install: use a less-baroque way to check for empty vars
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-zero committed Sep 17, 2020
1 parent bfa5206 commit 888cb2e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/pre-commit-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -o nounset

PYTHON=$(command -v python3 || true)

if [ x"${PYTHON}" = "x" ] ; then
if [ -z "${PYTHON}" ] ; then
echo "ERROR: the python3 executable could not be found, but is required for the complete build process"
exit 1
fi
Expand Down Expand Up @@ -39,18 +39,18 @@ ENVDIR=$(CDPATH='' cd -- "${ENVDIR}" && pwd)
PYTHON=$(command -v python)
PIP=$(command -v pip || true)

if [ x"${PIP}" = "x" ] ; then
if [ -z "${PIP}" ] ; then
echo "Bootstrapping the pip command inside the virtual environment..."

FETCHER="$(command -v curl || true)"
FETCHER_OPTS=""

if [ x"${FETCHER}" = "x" ] ; then
if [ -z "${FETCHER}" ] ; then
FETCHER="$(command -v wget || true)"
FETCHER_OPTS="-O-"
fi

if [ x"${FETCHER}" = "x" ] ; then
if [ -z "${FETCHER}" ] ; then
echo "ERROR: neither wget nor curl seem to be available, please download"
echo " https://bootstrap.pypa.io/get-pip.py"
echo "manually and run:"
Expand Down

0 comments on commit 888cb2e

Please sign in to comment.