nexus
nexus copied to clipboard
fix: coverage script reliability and cross-platform support
fixed a few issues in the coverage script:
- replaced
EXCLUDE="..."with an arrayEXCLUDES=(...)and used"${EXCLUDES[@]}"inlcov --remove, so patterns aren’t expanded by the shell. - changed
rm lcov.info && rm coverage.jsontorm -f lcov.info coverage.json, preventing failures whencoverage.jsonis missing. - updated
open coverage/foundry/index.htmlto check forxdg-open(Linux) andopen(macOS), making it cross-platform.
this should make the script more robust and portable.
PR-Codex overview
This PR updates the generate_coverage_report.sh script to improve the handling of excluded directories and enhance the file removal process, as well as the method for opening the coverage report in a cross-platform manner.
Detailed summary
- Changed
EXCLUDEvariable to an arrayEXCLUDES. - Updated
lcovcommand to use the array syntax for exclusions. - Modified the
rmcommand to use-ffor forceful removal of files. - Improved the method for opening the HTML report by checking for
xdg-openoropencommands.
✨ Ask PR-Codex anything about this PR by commenting with
/codex {your question}