From 888cb2e29cae1525ca8977f4c2df7d3b6fa7c69a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiziano=20M=C3=BCller?= Date: Wed, 9 Sep 2020 10:41:22 +0200 Subject: [PATCH] pre-commit-install: use a less-baroque way to check for empty vars --- tools/pre-commit-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/pre-commit-install.sh b/tools/pre-commit-install.sh index 66247a03e0..82b072050e 100755 --- a/tools/pre-commit-install.sh +++ b/tools/pre-commit-install.sh @@ -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 @@ -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:"