-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathclean.sh
More file actions
executable file
·63 lines (52 loc) · 1.28 KB
/
clean.sh
File metadata and controls
executable file
·63 lines (52 loc) · 1.28 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
LIBS=( utils init render loader )
ESC_CLEAR="\x1b[2K\x1b[0G"
msg1() {
wait
echo -e "${ESC_CLEAR}\x1b[1;32m==>\x1b[1;37m $*\x1b[0m"
}
msg2() {
wait
echo -e "${ESC_CLEAR} \x1b[1;34m--\x1b[1;37m $*\x1b[0m"
}
rm_save() {
local I TMP
if [[ "$1" == *'*'* ]]; then
TMP=( $1 )
for I in "${TMP[@]}"; do
[[ "$I" == "$1" ]] && return # Nothing
rm_save "$I"
done
return
fi
if [ -e "$1" ]; then
if [ -d "$1" ]; then
msg2 "Removing \x1b[35m[\x1b[36mDirectory\x1b[35m]\x1b[37m $1"
rm -rf "$1"
else
msg2 "Removing \x1b[35m[\x1b[36mFile\x1b[35m]\x1b[37m $1"
rm "$1"
fi
else
msg2 "Removing \x1b[35m[\x1b[36mNothing to do\x1b[35m]\x1b[37m $1"
fi
}
cd "$(dirname "$0")"
msg1 "Cleaning"
for (( I = 0; I < ${#LIBS[@]}; ++I )); do
rm_save "${LIBS[$I]}/CMakeLists.txt"
rm_save "${LIBS[$I]}/${LIBS[$I]}_export.hpp"
done
rm_save "include"
rm_save "utils/log/uMacros.hpp"
rm_save "utils/uEnum2Str.hpp"
rm_save "utils/uEnum2Str.cpp"
rm_save Doxyfile
for I in tests/*/; do
rm_save "${I}CMakeLists.txt"
if [ -f "${I}.gitignore" ]; then
for J in $( cat "${I}.gitignore" ); do
rm_save "${I}$J"
done
fi
done