moved download_data.sh to seperate module downloader

This commit is contained in:
saundersp
2024-04-27 20:47:30 +02:00
parent 211dcad893
commit 8740f7ea4b
5 changed files with 127 additions and 42 deletions

27
downloader/activate.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
# Exit if any of the command doesn't exit with code 0
set -e
test -z "$EXEC_DIR" && EXEC_DIR=.
test -z "$VENV_PATH" && VENV_PATH="$EXEC_DIR/venv"
activate(){
if [ ! -d "$VENV_PATH" ]; then
echo 'Creating python virtual environnement'
python -m venv "$VENV_PATH"
echo 'Activating virtual environnement'
activate
echo 'Updating base pip packages'
python -m pip install -U setuptools pip
echo 'Installing requirements'
pip install -r requirements.txt
elif [ -f "$VENV_PATH"/Scripts/activate ]; then . "$VENV_PATH"/Scripts/activate
elif [ -f "$VENV_PATH"/bin/activate ]; then . "$VENV_PATH"/bin/activate
else
echo 'Python virtual environnement not detected'
exit 1
fi
}
activate