-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_route_planner.sh
More file actions
executable file
·54 lines (44 loc) · 1.55 KB
/
run_route_planner.sh
File metadata and controls
executable file
·54 lines (44 loc) · 1.55 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
52
53
54
#!/bin/bash
"""
Route Planner Launcher Script
============================
This script provides a robust way to launch the Route Planner application
with proper environment setup and dependency checking.
"""
set -e # Exit on any error
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo -e "${BLUE}🚀 Starting Route Planner...${NC}"
# Check if Python is available
if ! command -v python3 &> /dev/null; then
echo -e "${RED}❌ Python 3 is not installed or not in PATH${NC}"
exit 1
fi
# Check Python version
PYTHON_VERSION=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
echo -e "${GREEN}✅ Python $PYTHON_VERSION detected${NC}"
# Check if virtual environment exists and activate it
if [ -d "venv" ]; then
echo -e "${YELLOW}🔧 Activating virtual environment...${NC}"
source venv/bin/activate
elif [ -d ".venv" ]; then
echo -e "${YELLOW}🔧 Activating virtual environment...${NC}"
source .venv/bin/activate
else
echo -e "${YELLOW}⚠️ No virtual environment found, using system Python${NC}"
fi
# Install dependencies if requirements.txt exists
if [ -f "requirements.txt" ]; then
echo -e "${YELLOW}📦 Checking dependencies...${NC}"
pip install -r requirements.txt --quiet
fi
# Launch the application
echo -e "${GREEN}🎯 Launching Route Planner application...${NC}"
python3 -m route_planner.core "$@"