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.
This commit is contained in:
Adrian Neumann 2017-02-24 19:25:39 +01:00 committed by GitHub
parent 77dab17722
commit db2a1f647d

View file

@ -26,7 +26,7 @@ install_macos_pkg()
BIN_NAME=$PKG_NAME BIN_NAME=$PKG_NAME
fi fi
BIN_LOCATION=$(which $BIN_NAME) BIN_LOCATION=$(which $BIN_NAME || true)
if [ -z "$BIN_LOCATION" ]; then if [ -z "$BIN_LOCATION" ]; then
echo "$PKG_MANAGER install $PKG_NAME" echo "$PKG_MANAGER install $PKG_NAME"
$PKG_MANAGER install "$PKG_NAME" $PKG_MANAGER install "$PKG_NAME"