Skip to content

Instantly share code, notes, and snippets.

@ajilo297
Created May 22, 2023 16:29
Show Gist options
  • Save ajilo297/0a99d43a16f1365d1d4e6511f4f5bd5c to your computer and use it in GitHub Desktop.
Save ajilo297/0a99d43a16f1365d1d4e6511f4f5bd5c to your computer and use it in GitHub Desktop.
Combine coverage for a melos monorepo for flutter
#!/usr/bin/env bash
escapedPath="$(echo `pwd` | sed 's/\//\\\//g')"
if grep flutter pubspec.yaml > /dev/null; then
if [ -d "coverage" ]; then
# combine line coverage info from package tests to a common file
if [ ! -d "$MELOS_ROOT_PATH/coverage_report" ]; then
mkdir "$MELOS_ROOT_PATH/coverage_report"
fi
sed "s/^SF:lib/SF:$escapedPath\/lib/g" coverage/lcov.info >> "$MELOS_ROOT_PATH/coverage_report/lcov.info"
rm -rf "coverage"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment