-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_norm.sh
More file actions
executable file
·48 lines (40 loc) · 951 Bytes
/
check_norm.sh
File metadata and controls
executable file
·48 lines (40 loc) · 951 Bytes
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
#!/bin/bash
# Flag to track if all files pass
all_ok=true
# Loop through all .c files in the src directory
for file in src/*.c; do
result=$(norminette $file)
if [[ "$result" == *"OK!"* ]]; then
echo "$file: OK!"
else
echo "$file: ERROR!"
all_ok=false
fi
done
for file in libft/*.c; do
result=$(norminette $file)
if [[ "$result" == *"OK!"* ]]; then
echo "$file: OK!"
else
echo "$file: ERROR!"
all_ok=false
fi
done
# Loop through all .h files in the include directory
for file in include/*.h; do
result=$(norminette $file)
if [[ "$result" == *"OK!"* ]]; then
echo "$file: OK!"
else
echo "$file: ERROR!"
all_ok=false
fi
done
# Return error code if any file failed
if [ "$all_ok" = false ]; then
echo "Some files did not pass Norminette checks!"
exit 1
else
echo "All files passed Norminette checks!"
exit 0
fi