-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_dev.sh
executable file
·49 lines (39 loc) · 1.13 KB
/
start_dev.sh
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
#!/bin/bash
# Define the virtual environment directory
VENV_DIR="venv"
# Create Python virtual environment if it doesn't exist and activate it
if [ ! -d "$VENV_DIR" ]; then
echo "Creating Python virtual environment..."
python3 -m venv "$VENV_DIR"
echo "Virtual environment created successfully"
else
echo "Using existing virtual environment"
fi
# Activate the virtual environment
if [ -f "$VENV_DIR/bin/activate" ]; then
echo "Activating Python virtual environment..."
. "$VENV_DIR/bin/activate" # Changed from source to dot
if [ $? -ne 0 ]; then
echo "Failed to activate virtual environment"
exit 1
fi
echo "Virtual environment activated successfully"
else
echo "Virtual environment activation script not found"
exit 1
fi
# Install dependencies
echo "Installing dependencies..."
"$VENV_DIR/bin/pip" install --no-cache-dir -r requirements.txt
if [ $? -ne 0 ]; then
echo "Failed to install dependencies"
exit 1
fi
echo "Dependencies installed successfully"
# Start the Flask app
echo "Starting Flask app..."
flask --app app.main run --debug
if [ $? -ne 0 ]; then
echo "Failed to start Flask app"
exit 1
fi