-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·49 lines (40 loc) · 970 Bytes
/
start.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
DEFAULT_HOST="127.0.0.1"
DEFAULT_PORT="4002"
usage() {
echo "Usage: $0 --exercise_folder <folder> [--host <host>] [--port <port>]"
exit 1
}
HOST="${SKILLAEGIS_HOST:-""}"
PORT="${SKILLAEGIS_PORT:-""}"
EXERCISE_FOLDER="${SKILLAEGIS_EXERCISE_FOLDER:-""}"
while [ "$#" -gt 0 ]; do
case "$1" in
--host)
HOST="$2"
shift 2
;;
--port)
PORT="$2"
shift 2
;;
--exercise_folder)
EXERCISE_FOLDER="$2"
shift 2
;;
*)
usage
;;
esac
done
if [ -z "$EXERCISE_FOLDER" ]; then
echo "Error: --exercise_folder value is required."
usage
fi
HOST=${HOST:-$DEFAULT_HOST}
PORT=${PORT:-$DEFAULT_PORT}
echo "EXERCISE_FOLDER: $EXERCISE_FOLDER"
echo "HOST: $HOST"
echo "PORT: $PORT"
source venv/bin/activate
EXERCISE_FOLDER="$EXERCISE_FOLDER" fastapi run main.py --host "$HOST" --port "$PORT"