-
Notifications
You must be signed in to change notification settings - Fork 1
/
monke.sh
executable file
·73 lines (66 loc) · 1.59 KB
/
monke.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# ANSI color escape codes
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
clean() {
echo -e "${YELLOW}Cleaning...${NC}"
make -C src clean
}
build() {
echo -e "${YELLOW}Building MonkeOS...${NC}"
make -C src
}
pack() {
echo -e "${YELLOW}Packing MonkeOS...${NC}"
echo =============================== >> logs.log
date >> logs.log
echo =============================== >> logs.log
build >> logs.log
echo =============================== >> logs.log
if [ -f "src/monkeos.iso" ]; then
tar -czvf monkeos.tar.bz2 -C src monkeos.iso
echo -e "${GREEN}Packed MonkeOS into monkeos.tar.bz2${NC}"
else
echo -e "${RED}Error: monkeos.iso not found in src directory.${NC}"
exit 1
fi
echo -e "${YELLOW}Clean before next build? (y/n)${NC}"
read -r answer
if [[ $answer =~ ^[Yy]$ ]]; then
clean
fi
}
run() {
echo -e "${YELLOW}Running QEMU...${NC}"
make -C src run
echo -e "${YELLOW}Clean before next run? (y/n)${NC}"
read -r answer
if [[ $answer =~ ^[Yy]$ ]]; then
clean
fi
}
case "$1" in
"clean")
clean
;;
"build")
build
;;
"pack")
pack
;;
"run")
echo =============================== >> logs.log
date >> logs.log
echo =============================== >> logs.log
build >> logs.log && run
echo =============================== >> logs.log
;;
*)
echo -e "${RED}Usage: $0 {clean|build|run|pack}${NC}"
exit 1
;;
esac
exit 0