From db2a1f647d0fd865b3e5263ac2cbb3f120509bae Mon Sep 17 00:00:00 2001 From: Adrian Neumann Date: Fri, 24 Feb 2017 19:25:39 +0100 Subject: [PATCH] Update bootstrap.sh On my OS X El Capitan machine `which` returns 1 if it can't find the binary. This kills the bootstrap script at the crucial moment when it detects that something needs to be installed. This change ignores unsuccessful exit codes from `which`. The man page for my `which` speaks of a `-s` switch that could be used instead of the `if [ -z`, but I don't know how portable this is. This fixes Issue 850. --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 5ea24b2..8d81ff7 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -26,7 +26,7 @@ install_macos_pkg() BIN_NAME=$PKG_NAME fi - BIN_LOCATION=$(which $BIN_NAME) + BIN_LOCATION=$(which $BIN_NAME || true) if [ -z "$BIN_LOCATION" ]; then echo "$PKG_MANAGER install $PKG_NAME" $PKG_MANAGER install "$PKG_NAME"