forked from SomeOddCodeGuy/WilmerAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_macos.sh
42 lines (37 loc) · 962 Bytes
/
run_macos.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
#!/bin/sh
# Ensure Unix line endings
if [ "${OSTYPE:0:6}" = "darwin" ]; then
# macOS
sed -i '' 's/\r$//' "$0"
else
# Linux and others
sed -i 's/\r$//' "$0"
fi
echo "Creating virtual environment..."
python3 -m venv venv
if [ ! $? -eq 0 ]; then
echo "Failed to create virtual environment."
exit 1
fi
echo "Virtual environment created successfully."
echo "Activating virtual environment..."
source venv/bin/activate
if [ ! $? -eq 0 ]; then
echo "Failed to activate virtual environment."
exit 1
fi
echo "Virtual environment activated."
echo "Installing dependencies from requirements.txt..."
pip install -r requirements.txt
if [ ! $? -eq 0 ]; then
echo "Failed to install dependencies."
exit 1
fi
echo "Dependencies installed successfully."
echo "Starting the application..."
python3 server.py "$@"
if [ ! $? -eq 0 ]; then
echo "Failed to start the application."
exit 1
fi
echo "Application started successfully."