alakazam/alakazam.sh
2024-05-02 15:34:27 +02:00

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