From a701e3f97a86036e9bc7592c620fffaf0bfa9852 Mon Sep 17 00:00:00 2001 From: "Roncero Blanco, Edgar" Date: Mon, 26 May 2025 19:02:37 +0200 Subject: [PATCH] POSIX compatible --- Run.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Run.sh diff --git a/Run.sh b/Run.sh new file mode 100644 index 0000000..2fc5d80 --- /dev/null +++ b/Run.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e # exit on error + +VENV_DIR=venv +APP_DIR=Program +PYTHON=$VENV_DIR/bin/python + +# Check if virtual environment exists +if [ ! -d "$VENV_DIR" ]; then + echo "Creating virtual environment..." + python3 -m venv "$VENV_DIR" + + echo "Installing dependencies..." + "$PYTHON" -m pip install --upgrade pip + "$PYTHON" -m pip install -r requirements.txt +else + echo "Virtual environment found, assuming dependencies are satisfied." +fi + +# Run the app +cd "$APP_DIR" +../"$PYTHON" app.py +