forked from UCSD-E4E/baboons-on-the-move
-
Notifications
You must be signed in to change notification settings - Fork 2
/
cli-linux
executable file
·46 lines (38 loc) · 994 Bytes
/
cli-linux
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
#!/bin/bash
SHELL_NAME=$(basename $SHELL)
echo Using $SHELL_NAME...
# Check to see if pyenv is on the path.
pyenv --version > /dev/null
if [ $? -ne 0 ]
then
# Update PATH
export PATH="$HOME/.pyenv/bin:$PATH"
pyenv --version > /dev/null
if [ $? -ne 0 ]
then
# Install pyenv if not found.
curl https://pyenv.run | $SHELL
fi
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
fi
# Check to see if pyenv has been added to the path.
cat ~/.${SHELL_NAME}rc | grep 'export PATH="$HOME/.pyenv/bin:$PATH"' > /dev/null
if [ $? -ne 0 ]
then
# Add pyenv to your path.
echo '
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"' >> ~/.${SHELL_NAME}rc
fi
PYTHON_VERSION=3.8.12
# Ensure Python is installed
pyenv versions | grep $PYTHON_VERSION > /dev/null
if [ $? -ne 0 ]
then
# Install Python
pyenv install $PYTHON_VERSION
fi
pyenv local $PYTHON_VERSION
python ./cli.py $@