diff --git a/scripts/analysis/analysis-wrapper.sh b/scripts/analysis/analysis-wrapper.sh index 0562e739caa1..8d01fc34c490 100755 --- a/scripts/analysis/analysis-wrapper.sh +++ b/scripts/analysis/analysis-wrapper.sh @@ -74,12 +74,27 @@ else # add comment with results lintResultNew=$(grep "Lint Report.* [0-9]* warnings" build/reports/lint/lint.html | cut -f2 -d':' |cut -f1 -d'<') + lintErrorNew=$(echo $lintResultNew | grep "[0-9]* error" -o | cut -f1 -d" ") + if ( [ -z $lintErrorNew ] ); then + lintErrorNew=0 + fi + lintWarningNew=$(echo $lintResultNew | grep "[0-9]* warning" -o | cut -f1 -d" ") + if ( [ -z $lintWarningNew ] ); then + lintWarningNew=0 + fi lintResultOld=$(curl 2>/dev/null https://raw.githubusercontent.com/nextcloud/android/$stableBranch/scripts/analysis/lint-results.txt) lintErrorOld=$(echo $lintResultOld | grep "[0-9]* error" -o | cut -f1 -d" ") + if ( [ -z $lintErrorOld ] ); then + lintErrorOld=0 + fi + lintWarningOld=$(echo $lintResultOld | grep "[0-9]* warning" -o | cut -f1 -d" ") + if ( [ -z $lintWarningOld ] ); then + lintWarningOld=0 + fi lintResult="
Type | $stableBranch | PR |
Warnings | "$lintWarningOld" | "$lintWarningNew" |
Errors | "$lintErrorOld" | "$lintErrorNew" |