From c48fe4e2a99ca8ff5951687b40dd83628c20ad4b Mon Sep 17 00:00:00 2001 From: Dan Callahan Date: Sat, 31 Oct 2015 15:27:13 -0500 Subject: [PATCH] bats is available in homebrew --- tests.mk | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests.mk b/tests.mk index 56f22fb2a..3c5837f41 100644 --- a/tests.mk +++ b/tests.mk @@ -1,10 +1,12 @@ +SYSTEM := $(shell sh -c 'uname -s 2>/dev/null') + shellcheck: -ifeq ($(shell shellcheck > /dev/null 2>&1 ; echo $$?),127) -ifeq ($(shell uname),Darwin) - brew install shellcheck +ifneq ($(shell shellcheck --version > /dev/null 2>&1 ; echo $$?),0) +ifeq ($(SYSTEM),Darwin) + brew install shellcheck else - sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse' - sudo apt-get update && sudo apt-get install -y shellcheck + sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse' + sudo apt-get update && sudo apt-get install -y shellcheck endif endif @@ -53,9 +55,15 @@ ifeq ($(shell grep dokku.me /home/dokku/VHOST 2>/dev/null),) endif bats: +ifneq ($(shell bats --version > /dev/null 2>&1 ; echo $$?),0) +ifeq ($(SYSTEM),Darwin) + brew install bats +else git clone https://github.com/sstephenson/bats.git /tmp/bats cd /tmp/bats && sudo ./install.sh /usr/local rm -rf /tmp/bats +endif +endif lint: # these are disabled due to their expansive existence in the codebase. we should clean it up though