-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup_mac.sh
executable file
·54 lines (37 loc) · 1.4 KB
/
setup_mac.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# File: setup_mac.sh
# Purpose: Set up anaconda and a virtualenv on a mac
# Author: Ryan Adams
# Date: 2016-Dec-16
# @todo: rmdir anaconda and suppress error (will only work if it's empty)
# @todo: maybe add a -f to reinstall even if anaconda is already there? Maybe not...
ANACONDA_DOWNLOAD=https://repo.continuum.io/archive/Anaconda2-4.2.0-MacOSX-x86_64.sh
ANACONDA_FILENAME=Anaconda2-4.2.0-MacOSX-x86_64.sh
# Scrub path so you can run this from anywhere
SCRIPT_PATH="`dirname \"$0\"`"
SCRIPT_PATH="`( cd \"$SCRIPT_PATH\" && pwd )`"
# Utility for moving around in the directories
pushd () {
command pushd "$@" > /dev/null
}
popd () {
command popd "$@" > /dev/null
}
mkdir -p "$SCRIPT_PATH/downloads"
# Download Anaconda
if [ ! -f "$SCRIPT_PATH/downloads/$ANACONDA_FILENAME" ]; then
pushd "$SCRIPT_PATH/downloads"
wget $ANACONDA_DOWNLOAD
popd
fi
# Install Anaconda locally
ANACONDA_PREFIX="$SCRIPT_PATH/anaconda"
# @todo: Check to see if anaconda is already installed and skip if so
echo "Installing Anaconda in $ANACONDA_PREFIX"
/bin/bash "$SCRIPT_PATH/downloads/$ANACONDA_FILENAME" -b -p "$ANACONDA_PREFIX"
# NOTE: RUN THESE COMMANDS MANUALLY
#alias conda="$SCRIPT_PATH/anaconda/bin/conda"
#conda update conda
#conda create python=2.7 anaconda --prefix "$SCRIPT_PATH/venv" -y
#source ./venv/bin/activate
# @todo: Figure out how to change the prompt (it's currently "(root)")