#!/bin/bash

set -e  # Exit immediately if any command exits with a non-zero status


activate_venv() {
    source env/bin/activate || { echo "Failed to activate virtual environment"; exit 1; }
}

install_module() {
    pip install --upgrade pip || { echo "Failed to upgrade pip"; exit 1; }  # Upgrade pip
    pip install -e . || { echo "Failed to install/upgrade module"; exit 1; }  # Install/upgrade modules
}

mv instance/alerts instance/assets

activate_venv
install_module
deactivate

echo -e "Your OwnchatBot configuration has been upgraded. Happy streaming!"
