elvish/tools/prune-cover.sh
Qi Xiao a8626bce1b Fixup for #1339
- Use explict ./ for consistency when invoking the script

- Rename script to "prune-cover.sh"

- Build ignore pattern in temporary file, and use grep -f to read it

- Use grep -F for correctness (path can contain dots)

- Add comment in .codecov.yml
2021-06-20 16:39:36 +01:00

18 lines
423 B
Bash
Executable File

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