diff --git a/setup.sh b/setup.sh index 6142975992..f1c2eca30d 100755 --- a/setup.sh +++ b/setup.sh @@ -9,6 +9,9 @@ downloadHighPolySuv=true MIN_CMAKE_VERSION=3.10.0 function version_less_than_equal_to() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1"; } +# brew gives error if package is already installed +function brew_install() { brew list $1 &>/dev/null || brew install $1; } + # Parse command line arguments while [[ $# -gt 0 ]] do @@ -63,7 +66,8 @@ if [ "$(uname)" == "Darwin" ]; then # osx sudo dseditgroup -o edit -a `whoami` -t user dialout fi - brew install wget coreutils + brew_install wget + brew_install coreutils if version_less_than_equal_to $cmake_ver $MIN_CMAKE_VERSION; then brew install cmake # should get cmake 3.8