2020-08-17 07:18:02 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-06-08 10:33:35 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
die() { echo "${1:-No error message given} (from $(basename $0))"; exit 1; }
|
|
|
|
|
2020-09-17 16:07:32 +00:00
|
|
|
if [[ "$(type -t bats)" != "" ]]; then
|
|
|
|
# bats is already installed.
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-06-08 10:33:35 +00:00
|
|
|
buildDir=$(mktemp -d)
|
|
|
|
git clone https://github.com/bats-core/bats-core $buildDir
|
|
|
|
|
|
|
|
pushd $buildDir
|
|
|
|
pwd
|
|
|
|
git reset --hard ${VERSION}
|
2020-09-17 16:07:32 +00:00
|
|
|
echo "Installing bats to /usr/local (requires root)"
|
|
|
|
sudo ./install.sh /usr/local
|
2020-06-08 10:33:35 +00:00
|
|
|
popd
|
|
|
|
|
|
|
|
rm -rf $buildDir
|