-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·42 lines (38 loc) · 1.21 KB
/
start.sh
File metadata and controls
executable file
·42 lines (38 loc) · 1.21 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
#!/bin/bash
DEFAULT_SF=1
if [[ ("$1" == "-dev") || ("$2" == "-dev") ]]; then
# Run in non-detached mode to show logs
if [[ ("$1" =~ ^[0-9]+$) ]]; then
SCALE_FACTOR="$1" docker-compose up --build
elif [[ ("$2" =~ ^[0-9]+$) ]]; then
SCALE_FACTOR="$2" docker-compose up --build
else
SCALE_FACTOR="$DEFAULT_SF" docker-compose up --build
fi
else
# Run in detached mode
if [[ ("$1" =~ ^[0-9]+$) ]]; then
SCALE_FACTOR="$1" docker-compose up --build -d
elif [[ ("$2" =~ ^[0-9]+$) ]]; then
SCALE_FACTOR="$2" docker-compose up --build -d
else
SCALE_FACTOR="$DEFAULT_SF" docker-compose up --build -d
fi
sleep 4
# Open the default browser based on the operating system
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
open http://localhost:5173/
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
xdg-open http://localhost:5173/
elif [[ "$OSTYPE" == "cygwin" ]]; then
# Cygwin (Windows)
start http://localhost:5173/
elif [[ "$OSTYPE" == "msys" ]]; then
# MinGW (Windows)
start http://localhost:5173/
else
echo "Unsupported OS. Please open the browser manually."
fi
fi