Skip to content

Commit

Permalink
Recover broken find pattern for UNIX (again)
Browse files Browse the repository at this point in the history
ref: codecov#184
continuous from: ada583b

codecov#180 makes `find` command change to run through
`execFileSync()`. However, it always returns empty result because of
the quote has over-included as the filename of search condition. So
removed quotes from generated conditions.

In addition, removing brackets from find arguments (a4cc565) has
affected to the result of finding coverage files. This commit reverts
brackets to get back the original search condition too.

Previously quotes and escaped-brackets are required to run command on
the shell environment, but no longer need them because of using
`execFileSync()` that is disabled shell environment by default.
  • Loading branch information
yhatt committed Jul 21, 2020
1 parent c0711c6 commit e3ff6ce
Showing 1 changed file with 60 additions and 58 deletions.
118 changes: 60 additions & 58 deletions lib/codecov.js
Expand Up @@ -20,64 +20,66 @@ var isWindows =

if (!isWindows) {
patterns = (
"-type f -name '*coverage.*' " +
"-or -name 'nosetests.xml' " +
"-or -name 'jacoco*.xml' " +
"-or -name 'clover.xml' " +
"-or -name 'report.xml' " +
"-or -name 'cobertura.xml' " +
"-or -name 'luacov.report.out' " +
"-or -name 'lcov.info' " +
"-or -name '*.lcov' " +
"-or -name 'gcov.info' " +
"-or -name '*.gcov' " +
"-or -name '*.lst' " +
"-not -name '*.sh' " +
"-not -name '*.data' " +
"-not -name '*.py' " +
"-not -name '*.class' " +
"-not -name '*.xcconfig' " +
"-not -name 'Coverage.profdata' " +
"-not -name 'phpunit-code-coverage.xml' " +
"-not -name 'coverage.serialized' " +
"-not -name '*.pyc' " +
"-not -name '*.cfg' " +
"-not -name '*.egg' " +
"-not -name '*.whl' " +
"-not -name '*.html' " +
"-not -name '*.js' " +
"-not -name '*.cpp' " +
"-not -name 'coverage.jade' " +
"-not -name 'include.lst' " +
"-not -name 'inputFiles.lst' " +
"-not -name 'createdFiles.lst' " +
"-not -name 'coverage.html' " +
"-not -name 'scoverage.measurements.*' " +
"-not -name 'test_*_coverage.txt' " +
"-not -path '*/vendor/*' " +
"-not -path '*/htmlcov/*' " +
"-not -path '*/home/cainus/*' " +
"-not -path '*/virtualenv/*' " +
"-not -path '*/js/generated/coverage/*' " +
"-not -path '*/.virtualenv/*' " +
"-not -path '*/virtualenvs/*' " +
"-not -path '*/.virtualenvs/*' " +
"-not -path '*/.env/*' " +
"-not -path '*/.envs/*' " +
"-not -path '*/env/*' " +
"-not -path '*/envs/*' " +
"-not -path '*/.venv/*' " +
"-not -path '*/.venvs/*' " +
"-not -path '*/venv/*' " +
"-not -path '*/venvs/*' " +
"-not -path '*/.git/*' " +
"-not -path '*/.hg/*' " +
"-not -path '*/.tox/*' " +
"-not -path '*/__pycache__/*' " +
"-not -path '*/.egg-info*' " +
"-not -path '*/$bower_components/*' " +
"-not -path '*/node_modules/*' " +
"-not -path '*/conftest_*.c.gcov'"
'-type f ( ' +
'-name *coverage.* ' +
'-or -name nosetests.xml ' +
'-or -name jacoco*.xml ' +
'-or -name clover.xml ' +
'-or -name report.xml ' +
'-or -name cobertura.xml ' +
'-or -name luacov.report.out ' +
'-or -name lcov.info ' +
'-or -name *.lcov ' +
'-or -name gcov.info ' +
'-or -name *.gcov ' +
'-or -name *.lst ' +
') ' +
'-not -name *.sh ' +
'-not -name *.data ' +
'-not -name *.py ' +
'-not -name *.class ' +
'-not -name *.xcconfig ' +
'-not -name Coverage.profdata ' +
'-not -name phpunit-code-coverage.xml ' +
'-not -name coverage.serialized ' +
'-not -name *.pyc ' +
'-not -name *.cfg ' +
'-not -name *.egg ' +
'-not -name *.whl ' +
'-not -name *.html ' +
'-not -name *.js ' +
'-not -name *.cpp ' +
'-not -name coverage.jade ' +
'-not -name include.lst ' +
'-not -name inputFiles.lst ' +
'-not -name createdFiles.lst ' +
'-not -name coverage.html ' +
'-not -name scoverage.measurements.* ' +
'-not -name test_*_coverage.txt ' +
'-not -path */vendor/* ' +
'-not -path */htmlcov/* ' +
'-not -path */home/cainus/* ' +
'-not -path */virtualenv/* ' +
'-not -path */js/generated/coverage/* ' +
'-not -path */.virtualenv/* ' +
'-not -path */virtualenvs/* ' +
'-not -path */.virtualenvs/* ' +
'-not -path */.env/* ' +
'-not -path */.envs/* ' +
'-not -path */env/* ' +
'-not -path */envs/* ' +
'-not -path */.venv/* ' +
'-not -path */.venvs/* ' +
'-not -path */venv/* ' +
'-not -path */venvs/* ' +
'-not -path */.git/* ' +
'-not -path */.hg/* ' +
'-not -path */.tox/* ' +
'-not -path */__pycache__/* ' +
'-not -path */.egg-info* ' +
'-not -path */$bower_components/* ' +
'-not -path */node_modules/* ' +
'-not -path */conftest_*.c.gcov'
).split(' ')
} else {
winPatterns = (
Expand Down

0 comments on commit e3ff6ce

Please sign in to comment.