Fix info stored in RESULT_linter...

This commit is contained in:
Alexandre Aubin 2020-12-02 16:55:54 +01:00
parent 04f1d548aa
commit 3d5f7fa1f3
2 changed files with 8 additions and 5 deletions

View file

@ -783,7 +783,7 @@ TEST_RESULTS () {
fi fi
# If the package linter returned a critical error, the app is flagged as broken / level 0 # If the package linter returned a critical error, the app is flagged as broken / level 0
if [ $RESULT_linter -le -2 ] if [ $RESULT_linter_broken -eq 1 ]
then then
ECHO_FORMAT "The package linter reported a critical failure ! App is considered broken !\n" "red" "bold" ECHO_FORMAT "The package linter reported a critical failure ! App is considered broken !\n" "red" "bold"
global_level=0 global_level=0
@ -865,6 +865,7 @@ initialize_values() {
RESULT_linter_level_6=0 RESULT_linter_level_6=0
RESULT_linter_level_7=0 RESULT_linter_level_7=0
RESULT_linter_level_8=0 RESULT_linter_level_8=0
RESULT_linter_broken=0
RESULT_global_setup=0 RESULT_global_setup=0
RESULT_global_remove=0 RESULT_global_remove=0
RESULT_check_sub_dir=0 RESULT_check_sub_dir=0

View file

@ -666,7 +666,7 @@ check_success () {
} }
check_warning () { check_warning () {
ECHO_FORMAT "--- WARNING ---\n" "lyellow" "bold" ECHO_FORMAT "--- WARNING ---\n" "lyellow" "bold"
} }
check_failed () { check_failed () {
@ -2010,6 +2010,7 @@ PACKAGE_LINTER () {
cat "$script_dir/temp_linter_result.log" | tee --append "$complete_log" cat "$script_dir/temp_linter_result.log" | tee --append "$complete_log"
cat "$script_dir/temp_linter_result.json" >> "$complete_log" cat "$script_dir/temp_linter_result.json" >> "$complete_log"
RESULT_linter_broken=0
RESULT_linter_level_6=0 RESULT_linter_level_6=0
RESULT_linter_level_7=0 RESULT_linter_level_7=0
RESULT_linter_level_8=0 RESULT_linter_level_8=0
@ -2034,10 +2035,11 @@ PACKAGE_LINTER () {
if [[ -n "$(cat "$script_dir/temp_linter_result.json" | jq ".critical" | grep -v '\[\]')" ]] if [[ -n "$(cat "$script_dir/temp_linter_result.json" | jq ".critical" | grep -v '\[\]')" ]]
then then
check_failed check_failed
RESULT_linter=-2 RESULT_linter_broken=1
RESULT_linter=-1
# If there are any regular errors, we'll cap to 4 # If there are any regular errors, we'll cap to 4
elif [[ -n "$(cat "$script_dir/temp_linter_result.json" | jq ".error" | grep -v '\[\]')" ]] elif [[ -n "$(cat "$script_dir/temp_linter_result.json" | jq ".error" | grep -v '\[\]')" ]]
then # FAil then
check_failed check_failed
RESULT_linter=-1 RESULT_linter=-1
# Otherwise, test pass (we'll display a warning depending on if there are # Otherwise, test pass (we'll display a warning depending on if there are
@ -2049,7 +2051,7 @@ PACKAGE_LINTER () {
RESULT_linter=1 RESULT_linter=1
else else
check_success check_success
RESULT_linter=2 RESULT_linter=1
fi fi
fi fi
} }