Add execution script

This commit is contained in:
Moritz 2024-05-02 15:34:27 +02:00
parent d5394d836a
commit 274ba9da32
2 changed files with 20 additions and 0 deletions

19
alakazam.sh Executable file
View File

@ -0,0 +1,19 @@
#!/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

View File

@ -4,3 +4,4 @@ ruamel.yaml==0.18.3
Jinja2==2.11.3
MarkupSafe==1.1.1
python-dotenv==1.0.0
icecream==2.1.3