Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Stop processing on any error. |
| 4 | set -e |
| 5 | |
| 6 | function install_if_not_installed() { |
| 7 | declare -r formula="$1" |
| 8 | if [[ $(brew list ${formula} &>/dev/null; echo $?) -ne 0 ]]; then |
| 9 | brew install ${formula} |
| 10 | else |
| 11 | echo "$0 - ${formula} is already installed." |
| 12 | fi |
| 13 | } |
| 14 | |
Austin Schuh | 1d1e6ea | 2020-12-23 21:56:30 -0800 | [diff] [blame^] | 15 | # Manually trigger an update prior to installing packages to avoid Ruby |
| 16 | # version related errors as per [1]. |
| 17 | # |
| 18 | # [1]: https://github.com/travis-ci/travis-ci/issues/8552 |
| 19 | brew update |
| 20 | |
Austin Schuh | 70cc955 | 2019-01-21 19:46:48 -0800 | [diff] [blame] | 21 | install_if_not_installed cmake |
| 22 | install_if_not_installed glog |
| 23 | install_if_not_installed gflags |
| 24 | install_if_not_installed eigen |
| 25 | install_if_not_installed suite-sparse |