-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup-mac.sh
49 lines (35 loc) · 1.19 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
#!/bin/sh
echo -e "\n\n*==============================================================================*\n"
echo -e " This will install brew, pyenv, pyenv-virtualenv, xcode commandline-tools\n"
echo -e " \n"
echo -e " It will also create the django_iso_manager virtualenv and add it to .pythonversion\n"
echo -e "*==============================================================================*\n"
read -rsp $'Press any key to continue...\n' -n1 key </dev/tty
if ! command -v brew &> /dev/null
then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew update
brew install pyenv pyenv-virtualenv
touch ~/.zprofile
cat > ~/.zprofile << EOF
if which pyenv-virtualenv-init > /dev/null; then eval "\$(pyenv virtualenv-init -)"; fi
EOF
touch ~/.zshrc
cat > ~/.zshrc << EOF
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PIPENV_PYTHON="$PYENV_ROOT/shims/python"
plugin=(
pyenv
)
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
EOF
source ~/.zprofile
source ~/.zshrc
xcode-select --install
pyenv install 3.10.0
pyenv-virtualenv 3.10.0 django_iso_manager
echo django_iso_manager > .python-version