20 lines
525 B
Bash
Executable File
20 lines
525 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Get the directory of the script being run.
|
|
SCRIPT_DIR="$( cd "$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" &> /dev/null && pwd )"
|
|
VENV_PATH=$SCRIPT_DIR/.venv
|
|
|
|
# check if venv exists
|
|
if [ ! -d $VENV_PATH ]; then
|
|
echo install virtual environment: $VENV_PATH
|
|
python3 -m venv $VENV_PATH
|
|
source $VENV_PATH/bin/activate
|
|
pip3 install -r requirements.txt
|
|
deactivate
|
|
fi
|
|
|
|
# Activate the virtual environment
|
|
source $VENV_PATH/bin/activate
|
|
python3 $SCRIPT_DIR/alakazam.py $@
|
|
deactivate
|