Skip to content

Commit

Permalink
Merge pull request containers#7674 from xordspar0/bats-install-root
Browse files Browse the repository at this point in the history
Install bats as root
  • Loading branch information
openshift-merge-robot authored Sep 19, 2020
2 parents 6b5aa99 + d20a37b commit 8529435
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hack/install_bats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ set -e

die() { echo "${1:-No error message given} (from $(basename $0))"; exit 1; }

if [[ "$(type -t bats)" != "" ]]; then
# bats is already installed.
exit 0
fi

buildDir=$(mktemp -d)
git clone https://github.com/bats-core/bats-core $buildDir

pushd $buildDir
pwd
git reset --hard ${VERSION}
./install.sh /usr/local
echo "Installing bats to /usr/local (requires root)"
sudo ./install.sh /usr/local
popd

rm -rf $buildDir

0 comments on commit 8529435

Please sign in to comment.