diff --git a/scripts/macos_dependencies.sh b/scripts/macos_dependencies.sh index 950d2ffb..746370ad 100755 --- a/scripts/macos_dependencies.sh +++ b/scripts/macos_dependencies.sh @@ -1,10 +1,22 @@ -#!/bin/bash +#!/usr/bin/env bash + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -ROOT=$DIR/../ +ROOT="$(cd $DIR/../ && pwd)" +ARCH=$(uname -m) + +if [[ $SHELL == "/bin/zsh" ]]; then + RC_FILE="$HOME/.zshrc" +elif [[ $SHELL == "/bin/bash" ]]; then + RC_FILE="$HOME/.bash_profile" +fi +# Install brew if required if [[ $(command -v brew) == "" ]]; then + echo "Installing Homebrew" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + echo "[ ] installed brew t=$SECONDS" + # make brew available now if [[ $ARCH == "x86_64" ]]; then echo 'eval "$(/usr/local/homebrew/bin/brew shellenv)"' >> $RC_FILE eval "$(/usr/local/homebrew/bin/brew shellenv)"