Skip to content

Instantly share code, notes, and snippets.

@jerrythomas
Last active October 30, 2023 16:01
Show Gist options
  • Save jerrythomas/2b9c998d74e2b0c545d458267379bf6b to your computer and use it in GitHub Desktop.
Save jerrythomas/2b9c998d74e2b0c545d458267379bf6b to your computer and use it in GitHub Desktop.
merge lcov.info from packages under a monorepo into a single one.
#!/bin/bash
files=`find ./ -name lcov.info`
args=""
for f in $files; do
prefix=`echo $f | sed -e s/coverage.lcov.info// | sed -e s#^\./##`
echo "fixing paths in $f"
sed -i.bak "s#^SF\:src#SF\:${prefix}src#g" $f
args="$args -a $f"
done
echo $args | xargs lcov -o lcov.info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment