浏览代码

analysis-wrapper.sh: fix not Null check

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 3 年之前
父节点
当前提交
fb7bba8fe4
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      scripts/analysis/analysis-wrapper.sh

+ 2 - 2
scripts/analysis/analysis-wrapper.sh

@@ -128,7 +128,7 @@ else
     fi
 
     # check for NotNull
-    if [[ $(grep org.jetbrains.annotations src/main/* -ir -c) -gt 0 ]] ; then
+    if [[ $(grep org.jetbrains.annotations src/main/* -irl | wc -l) -gt 0 ]] ; then
         notNull="org.jetbrains.annotations.NotNull is used. Please use androidx.annotation.NonNull instead.<br><br>"
     fi
 
@@ -146,7 +146,7 @@ else
         exit $lintValue
     fi
 
-    if [ $notNull -gt 0 ]; then
+    if [ -z "$notNull" ]; then
         exit 1
     fi