27
27
28
28
ERRORS=false
29
29
30
+ echo 🔎 Subalfred feature checks
30
31
for dir in $( cat list) ; do
31
32
echo
32
33
RESULT=$( subalfred check features $dir )
33
34
CHECK_RESULT=$? # 0 if it's good, anything else is bad
34
35
36
+ # If subalfred fails with 130||1, then we dont want to proceed with the check
37
+ # Its probably cargo error
38
+ if [[ $CHECK_RESULT == 130 || $CHECK_RESULT == 1 ]]; then
39
+ echo " ❌ Subalfred failed to run check features in $dir "
40
+ echo " $RESULT "
41
+ ERRORS=true
42
+
43
+ continue
44
+ fi
45
+
46
+ # Sanitizing subalfred output
47
+ # First line is always "checking: $PATH/Cargo.toml"
48
+ RESULT=$( echo " $RESULT " | tail -n+2)
49
+
35
50
# Filter out false positives
36
51
RESULT_OUTPUT=$( echo " $RESULT " | grep -vE " ($1 )" )
52
+ # Trim whitespaces
53
+ RESULT_OUTPUT=${RESULT_OUTPUT##* ( )}
54
+
55
+ # We are checking here if there is anything left in the output after filtering out false positives
56
+ if [[ " $RESULT_OUTPUT " == " " ]]; then
57
+ echo " ✅ $dir "
58
+ continue
59
+ fi
37
60
38
61
echo " $RESULT_OUTPUT " | grep ' `std`' > /dev/null
39
62
GREP_RESULT=$? # 0 if it's bad, 1 if it's good
40
63
41
- if [[ -z " $RESULT_OUTPUT " ]]; then
42
- echo " 🟡 $dir "
43
- fi
44
- # If there are no errors in subalfred check, then we're good
45
- if [[ $CHECK_RESULT == 0 ]]; then
46
- echo " ✅ $dir "
47
-
48
64
# If result is non empty and there are no std features, then we're yellow
49
- elif [[ " $GREP_RESULT " == 1 && " $CHECK_RESULT " != 0 && " $RESULT_OUTPUT " != " " ]]; then
65
+ if [[ " $GREP_RESULT " == 1 && " $CHECK_RESULT " != 0 && " $RESULT_OUTPUT " != " " ]]; then
50
66
echo " 🟡 $dir "
51
67
echo -e " $RESULT_OUTPUT "
52
68
61
77
if [[ $ERRORS == true ]]; then
62
78
exit 1
63
79
fi
80
+
81
+ rm list
0 commit comments