From 86a9f4c16d5d4d50c2f5e3cd30b5aecf171e085c Mon Sep 17 00:00:00 2001 From: Saksham Date: Wed, 3 Jun 2020 15:50:11 +0530 Subject: [PATCH 1/3] added checks for python, bazel & pipenv --- prereqs_mac.sh | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) 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 From bac661be155bcaea6fe0928a42ede526fddd11f1 Mon Sep 17 00:00:00 2001 From: Saksham Date: Thu, 11 Jun 2020 01:53:03 +0530 Subject: [PATCH 2/3] install bazel using binary installer --- prereqs_mac.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/prereqs_mac.sh b/prereqs_mac.sh index 5b3cb262..4b25f2ba 100755 --- a/prereqs_mac.sh +++ b/prereqs_mac.sh @@ -23,9 +23,12 @@ fi 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 + echo "Donwloading Bazel 3.2.0" + curl -LO https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-installer-darwin-x86_64.sh + chmod +x bazel-3.2.0-installer-darwin-x86_64.sh + ./bazel-3.2.0-installer-darwin-x86_64.sh + export PATH="$PATH:$HOME/bin" + rm bazel-3.2.0-installer-darwin-x86_64.sh fi # pipenv From 0b0fda89a83f0dc36687414ade4ed10f2957781a Mon Sep 17 00:00:00 2001 From: Saksham Date: Thu, 11 Jun 2020 04:04:19 +0530 Subject: [PATCH 3/3] switched back --- prereqs_mac.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/prereqs_mac.sh b/prereqs_mac.sh index 4b25f2ba..5b3cb262 100755 --- a/prereqs_mac.sh +++ b/prereqs_mac.sh @@ -23,12 +23,9 @@ fi if command -v bazel &>/dev/null; then echo "Bazel already installed" else - echo "Donwloading Bazel 3.2.0" - curl -LO https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-installer-darwin-x86_64.sh - chmod +x bazel-3.2.0-installer-darwin-x86_64.sh - ./bazel-3.2.0-installer-darwin-x86_64.sh - export PATH="$PATH:$HOME/bin" - rm bazel-3.2.0-installer-darwin-x86_64.sh + echo "Downloading and installing Bazel using homebrew" + brew tap bazelbuild/tap + brew install bazelbuild/tap/bazel fi # pipenv