-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·51 lines (43 loc) · 1.38 KB
/
run.sh
File metadata and controls
executable file
·51 lines (43 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Configuration
PYTHON_VERSION="python3.12"
VENV_DIR="venv"
REQUIREMENTS_FILE="requirements.txt"
APP_SCRIPT="server.py"
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${YELLOW}Starting AURA System Setup...${NC}"
# 1. Check for Python 3.12
if ! command -v $PYTHON_VERSION &> /dev/null; then
echo -e "${RED}Error: $PYTHON_VERSION could not be found.${NC}"
echo "Please install Python 3.12 to proceed."
exit 1
fi
# 2. Check/Create Virtual Environment
if [ ! -d "$VENV_DIR" ]; then
echo -e "${YELLOW}Creating virtual environment with $PYTHON_VERSION...${NC}"
$PYTHON_VERSION -m venv $VENV_DIR
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to create virtual environment.${NC}"
exit 1
fi
echo -e "${GREEN}Virtual environment created.${NC}"
echo -e "${GREEN}Virtual environment created.${NC}"
fi
# Activate and Install Dependencies (Always)
source $VENV_DIR/bin/activate
echo -e "${YELLOW}Installing dependencies...${NC}"
pip install --upgrade pip
if [ -f "$REQUIREMENTS_FILE" ]; then
pip install -r $REQUIREMENTS_FILE
else
echo -e "${RED}Warning: $REQUIREMENTS_FILE not found.${NC}"
fi
# 5. Run Application
echo -e "${GREEN}Starting Application...${NC}"
echo -e "${GREEN}Dashboard available at: http://localhost:8000${NC}"
echo -e "${YELLOW}Press Ctrl+C to stop.${NC}"
python $APP_SCRIPT