POSIX compatible
This commit is contained in:
23
Run.sh
Normal file
23
Run.sh
Normal file
@@ -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
|
||||
|
Reference in New Issue
Block a user