-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.sh
More file actions
24 lines (21 loc) · 1.11 KB
/
init.sh
File metadata and controls
24 lines (21 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# this script should help add an alias to bashrc and ensure that there is a coliseum virtual env containing all its dependencies
# there are a few areas for this script to be improved:
# 1. check if there is an alias already existing in .bashrc and, if so, replace it https://unix.stackexchange.com/a/32507
# 2. should include some boilerplate provisions for the user to delete existing records & do some cleanup to avoid to much bloat/mess/zombie code from this
if [ $VIRTUAL_ENV ]
then
pip install coliseum
CMD=$(printf 'source %s/bin/activate && python -m coliseum && deactivate' $VIRTUAL_ENV)
echo $CMD
echo alias coliseum=\""$CMD"\" >> /home/$USER/.bashrc
else
echo You are not running a virtualenv, we are creating one here...
python3 -m venv venv || python36 -m venv venv || python -m venv venv || exit
source $PWD/venv/bin/activate
pip install coliseum
CMD=$(printf 'source %s/bin/activate && python -m coliseum && deactivate' $VIRTUAL_ENV)
echo $CMD
echo alias coliseum=\""$CMD"\" >> /home/$USER/.bashrc
deactivate
fi