From b1c66391cdaecb0ef00adc0ec95e23b72f8d966f Mon Sep 17 00:00:00 2001 From: Konstantin Gredeskoul Date: Wed, 10 Jul 2019 20:12:56 -0700 Subject: [PATCH] Fixing Bats installation on Mac OSX Mojave --- install.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 8bbdd16..f88eff5 100755 --- a/install.sh +++ b/install.sh @@ -28,10 +28,17 @@ if [ -z "$1" ]; then fi BATS_ROOT="$(abs_dirname "$0")" -mkdir -p "$PREFIX"/{bin,libexec,share/man/man{1,7}} -cp -R "$BATS_ROOT"/bin/* "$PREFIX"/bin -cp -R "$BATS_ROOT"/libexec/* "$PREFIX"/libexec -cp "$BATS_ROOT"/man/bats.1 "$PREFIX"/share/man/man1 -cp "$BATS_ROOT"/man/bats.7 "$PREFIX"/share/man/man7 +echo "Installing binaries..." -echo "Installed Bats to $PREFIX/bin/bats" +[[ -d "$PREFIX"/share/bats ]] || mkdir -p "$PREFIX"/share/bats +[[ -d "$PREFIX"/bin ]] || mkdir -p "$PREFIX"/bin + +cp -Rv "$BATS_ROOT"/libexec/* "$PREFIX"/share/bats + +for binary in $(ls -1 libexec); do + ln -svf "$PREFIX"/share/bats/${binary} "$PREFIX"/bin/${binary} +done + +echo "Installed bats into ${PREFIX}/bin:" + +ls -al ${PREFIX}/bin/bats*