source_me.sh 284 Bytes
Newer Older
Thom Wiggers's avatar
Thom Wiggers committed
1
#!/bin/bash
Thom Wiggers's avatar
Thom Wiggers committed
2
pathname=$_
Thom Wiggers's avatar
Thom Wiggers committed
3

4
if [[ -n "$BASH" && "$pathname" = "$0" ]]; then
Thom Wiggers's avatar
Thom Wiggers committed
5
    echo "Remember: you need to run me as 'source ./source_me.sh', not execute it!"
Thom Wiggers's avatar
Thom Wiggers committed
6
7
    return
fi
Thom Wiggers's avatar
Thom Wiggers committed
8
9
10
11

if [ -d venv ]; then
    source venv/bin/activate
else
12
    python3 -m venv venv
Thom Wiggers's avatar
Thom Wiggers committed
13
14
    source venv/bin/activate
fi