diff options
author | Tyler Davis <tydavis@gmail.com> | 2020-12-28 08:32:40 -0800 |
---|---|---|
committer | Tyler Davis <tydavis@gmail.com> | 2020-12-28 08:32:40 -0800 |
commit | 893840005fa3647919007a45d52340db664211e8 (patch) | |
tree | 5351bbd8f3b7514ed1f000ac44b3e4aeb26f1acb /.setup/installbrew.sh | |
parent | aef5b259cc887aaa9fff037ebd13de7e4fbbb3cd (diff) | |
download | dotfiles-893840005fa3647919007a45d52340db664211e8.tar.gz dotfiles-893840005fa3647919007a45d52340db664211e8.zip |
brew: new install file
Diffstat (limited to '.setup/installbrew.sh')
-rw-r--r-- | .setup/installbrew.sh | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/.setup/installbrew.sh b/.setup/installbrew.sh index e5886b8..f922350 100644 --- a/.setup/installbrew.sh +++ b/.setup/installbrew.sh @@ -7,9 +7,17 @@ if [[ ! -t 0 || -n "${CI-}" ]]; then NONINTERACTIVE=1 fi -# First check if the OS is Linux. -if [[ "$(uname)" = "Linux" ]]; then +abort() { + printf "%s\n" "$1" + exit 1 +} + +# First check OS. +OS="$(uname)" +if [[ "$OS" == "Linux" ]]; then HOMEBREW_ON_LINUX=1 +elif [[ "$OS" != "Darwin" ]]; then + abort "Homebrew is only supported on macOS and Linux." fi # On macOS, this script installs to /usr/local only. @@ -117,11 +125,6 @@ warn() { printf "${tty_red}Warning${tty_reset}: %s\n" "$(chomp "$1")" } -abort() { - printf "%s\n" "$1" - exit 1 -} - execute() { if ! "$@"; then abort "$(printf "Failed during: %s" "$(shell_join "$@")")" |