-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·45 lines (40 loc) · 992 Bytes
/
run.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
#add colors to echo's
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
GREEN='\033[1;32m'
RED='\033[1;31m'
RESET='\033[0m'
echo -e "${YELLOW}Compiling...${RESET}"
make
if [ $? -ne 0 ]; then
echo -e "${RED}Compilation failed!${RESET}"
exit 1
fi
echo -e "${GREEN}Compilation done!${RESET}"
echo -e "${YELLOW}Running...${RESET}"
# check if the folder output/results exists, if not create it
if [ ! -d "output/results" ]; then
mkdir -p output/results
else
# remove the files inside output/results
rm -rf output/results/*
fi
rm -rf output/*.h5
./bin/main
if [ $? -ne 0 ]; then
echo -e "${RED}Running failed!${RESET}"
exit 1
fi
echo -e "${GREEN}Running done!${RESET}"
echo -e "${YELLOW}Animating...${RESET}"
# use python3 if you have it installed, otherwise use python
if [ -x "$(command -v python3)" ]; then
python3 src/animation.py
else
python src/animation.py
fi
if [ $? -ne 0 ]; then
echo -e "${RED}Animating failed!${RESET}"
exit 1
fi
echo -e "${GREEN}Animating done!${RESET}"