Skip to content

Commit 40a2bba

Browse files
authored
Merge pull request #3273 from rajat2004/fix-osx-install
Only install packages if required on OSX
2 parents 6ac9706 + 900d315 commit 40a2bba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

setup.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ downloadHighPolySuv=true
99
MIN_CMAKE_VERSION=3.10.0
1010
function version_less_than_equal_to() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1"; }
1111

12+
# brew gives error if package is already installed
13+
function brew_install() { brew list $1 &>/dev/null || brew install $1; }
14+
1215
# Parse command line arguments
1316
while [[ $# -gt 0 ]]
1417
do
@@ -63,7 +66,8 @@ if [ "$(uname)" == "Darwin" ]; then # osx
6366
sudo dseditgroup -o edit -a `whoami` -t user dialout
6467
fi
6568

66-
brew install wget coreutils
69+
brew_install wget
70+
brew_install coreutils
6771

6872
if version_less_than_equal_to $cmake_ver $MIN_CMAKE_VERSION; then
6973
brew install cmake # should get cmake 3.8

0 commit comments

Comments
 (0)