mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-01 08:42:55 +08:00
a8626bce1b
- 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
18 lines
423 B
Bash
Executable File
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
|