diff --git a/prereqs_mac.sh b/prereqs_mac.sh index d2d0ce5d..5b3cb262 100755 --- a/prereqs_mac.sh +++ b/prereqs_mac.sh @@ -1,5 +1,6 @@ #!/bin/bash +# homebrew which -s brew if [[ $? != 0 ]] ; then # Install Homebrew @@ -9,18 +10,32 @@ else brew update fi -# TODO: We want to check if user has python already installed. -# In-case if they have some other version of python installed, -# this will create yet another installation. - -# echo "Downloading and installing Python3 using homebrew" -# brew install python3 +# python 3 +echo "Checking for python3 installation" +if command -v python3 &>/dev/null; then + echo "Python 3 already installed" +else + echo "Downloading and installing Python3 using homebrew" + brew install python3 +fi -# checking for bazel -echo "Downloading and installing Bazel using homebrew" -brew tap bazelbuild/tap -brew install bazelbuild/tap/bazel +# bazel +if command -v bazel &>/dev/null; then + echo "Bazel already installed" +else + echo "Downloading and installing Bazel using homebrew" + brew tap bazelbuild/tap + brew install bazelbuild/tap/bazel +fi +# pipenv +echo "Checking for pipenv" +if python3 -c "import pipenv" &> /dev/null; then + echo "pipenv is already installed" +else + echo "installing pipenv" + pip3 install pipenv +fi # Downloading the Google DP library git submodule update --init --recursive