prune-cover.sh 423 B

1234567891011121314151617
  1. #!/bin/sh -e
  2. # Prune the same objects from the "make cover" report that we tell Codecov
  3. # (https://codecov.io/gh/elves/elvish/) to ignore.
  4. if test $# != 2
  5. then
  6. echo 'Usage: cover_prune.sh ${codecov.yml} $cover' >&2
  7. exit 1
  8. fi
  9. yaml="$1"
  10. data="$2"
  11. sed -En '/^ignore:/,/^[^ ]/s/^ *- "(.*)"/src.elv.sh\/\1/p' $yaml > $yaml.ignore
  12. grep -F -v -f $yaml.ignore $data > $data.pruned
  13. mv $data.pruned $data
  14. rm $yaml.ignore