bugcounts.sh 653 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. projects="$1"
  3. issuesDir="$2"
  4. tablesDir="$3"
  5. for p in $projects; do
  6. f="$issuesDir/$p-issues/res0.json"
  7. #echo $f
  8. #jq '.issues | length' "$f"
  9. if [ "$(jq '.issues | length' "$f")" -gt 0 ]; then
  10. allIssues="$(jq '.issues | .[] | .key' "$f" | tr -d '"-' | sort | uniq)"
  11. blamedIssues="$(cut -d, -f2 "$tablesDir/$p" | sort | uniq)"
  12. echo $allIssues
  13. echo $blamedIssues
  14. allIssuesCount=$(echo "$allIssues" | grep -v '^$' | wc -l)
  15. blamedIssuesCount=$(echo "$blamedIssues" | grep -v '^$' | wc -l)
  16. echo "$p,$allIssuesCount,$blamedIssuesCount"
  17. else
  18. echo "$p,0,0"
  19. fi
  20. done