Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit 7148c18

Browse files
committed
What are the chances that Windows has a find?
1 parent de77ff3 commit 7148c18

File tree

2 files changed

+123
-63
lines changed

2 files changed

+123
-63
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ install:
1919
- npm install
2020

2121
test_script:
22-
# - cmd: SET PATH=C:\MinGW\bin;%PATH%
22+
- cmd: SET PATH=C:\MinGW\bin;%PATH%
2323
- npm run test
2424

2525
after_test:

lib/codecov.js

Lines changed: 122 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var detectProvider = require('./detect')
1111

1212
var version = 'v' + require('../package.json').version
1313

14-
var patterns, more_patterns, winPatterns
14+
var patterns, more_patterns //, winPatterns
1515

1616
var isWindows =
1717
process.platform.match(/win32/) || process.platform.match(/win64/)
@@ -78,66 +78,126 @@ if (!isWindows) {
7878
"-not -path '*/conftest_*.c.gcov'"
7979
).split(' ')
8080
} else {
81-
winPatterns = (
82-
'/a:-d /b /s *coverage.* ' +
83-
'/s nosetests.xml ' +
84-
'/s jacoco*.xml ' +
85-
'/s clover.xml ' +
86-
'/s report.xml ' +
87-
'/s cobertura.xml ' +
88-
'/s luacov.report.out ' +
89-
'/s lcov.info ' +
90-
'/s *.lcov ' +
91-
'/s gcov.info ' +
92-
'/s *.gcov ' +
93-
'/s *.lst' +
94-
'| findstr /i /v \\.sh$ ' +
95-
'| findstr /i /v \\.data$ ' +
96-
'| findstr /i /v \\.py$ ' +
97-
'| findstr /i /v \\.class$ ' +
98-
'| findstr /i /v \\.xcconfig$ ' +
99-
'| findstr /i /v Coverage\\.profdata$ ' +
100-
'| findstr /i /v phpunit-code-coverage\\.xml$ ' +
101-
'| findstr /i /v coverage\\.serialized$ ' +
102-
'| findstr /i /v \\.pyc$ ' +
103-
'| findstr /i /v \\.cfg$ ' +
104-
'| findstr /i /v \\.egg$ ' +
105-
'| findstr /i /v \\.whl$ ' +
106-
'| findstr /i /v \\.html$ ' +
107-
'| findstr /i /v \\.js$ ' +
108-
'| findstr /i /v \\.cpp$ ' +
109-
'| findstr /i /v coverage\\.jade$ ' +
110-
'| findstr /i /v include\\.lst$ ' +
111-
'| findstr /i /v inputFiles\\.lst$ ' +
112-
'| findstr /i /v createdFiles\\.lst$ ' +
113-
'| findstr /i /v coverage\\.html$ ' +
114-
'| findstr /i /v scoverage\\.measurements\\..* ' +
115-
'| findstr /i /v test_.*_coverage\\.txt ' +
116-
'| findstr /i /v \\vendor\\ ' +
117-
'| findstr /i /v \\htmlcov\\ ' +
118-
'| findstr /i /v \\home\\cainus\\ ' +
119-
'| findstr /i /v \\js\\generated\\coverage\\ ' +
120-
'| findstr /i /v \\virtualenv\\ ' +
121-
'| findstr /i /v \\virtualenvs\\ ' +
122-
'| findstr /i /v \\\\.virtualenv\\ ' +
123-
'| findstr /i /v \\\\.virtualenvs\\ ' +
124-
'| findstr /i /v \\\\.env\\ ' +
125-
'| findstr /i /v \\\\.envs\\ ' +
126-
'| findstr /i /v \\env\\ ' +
127-
'| findstr /i /v \\envs\\ ' +
128-
'| findstr /i /v \\\\.venv\\ ' +
129-
'| findstr /i /v \\\\.venvs\\ ' +
130-
'| findstr /i /v \\venv\\ ' +
131-
'| findstr /i /v \\venvs\\ ' +
132-
'| findstr /i /v \\\\.git\\ ' +
133-
'| findstr /i /v \\\\.hg\\ ' +
134-
'| findstr /i /v \\\\.tox\\ ' +
135-
'| findstr /i /v \\__pycache__\\ ' +
136-
'| findstr /i /v \\\\.egg-info* ' +
137-
'| findstr /i /v \\\\$bower_components\\ ' +
138-
'| findstr /i /v \\node_modules\\ ' +
139-
'| findstr /i /v \\conftest_.*\\.c\\.gcov '
81+
patterns = (
82+
"-type f -name '*coverage.*' " +
83+
"-or -name 'nosetests.xml' " +
84+
"-or -name 'jacoco*.xml' " +
85+
"-or -name 'clover.xml' " +
86+
"-or -name 'report.xml' " +
87+
"-or -name 'cobertura.xml' " +
88+
"-or -name 'luacov.report.out' " +
89+
"-or -name 'lcov.info' " +
90+
"-or -name '*.lcov' " +
91+
"-or -name 'gcov.info' " +
92+
"-or -name '*.gcov' " +
93+
"-or -name '*.lst' " +
94+
"-not -name '*.sh' " +
95+
"-not -name '*.data' " +
96+
"-not -name '*.py' " +
97+
"-not -name '*.class' " +
98+
"-not -name '*.xcconfig' " +
99+
"-not -name 'Coverage.profdata' " +
100+
"-not -name 'phpunit-code-coverage.xml' " +
101+
"-not -name 'coverage.serialized' " +
102+
"-not -name '*.pyc' " +
103+
"-not -name '*.cfg' " +
104+
"-not -name '*.egg' " +
105+
"-not -name '*.whl' " +
106+
"-not -name '*.html' " +
107+
"-not -name '*.js' " +
108+
"-not -name '*.cpp' " +
109+
"-not -name 'coverage.jade' " +
110+
"-not -name 'include.lst' " +
111+
"-not -name 'inputFiles.lst' " +
112+
"-not -name 'createdFiles.lst' " +
113+
"-not -name 'coverage.html' " +
114+
"-not -name 'scoverage.measurements.*' " +
115+
"-not -name 'test_*_coverage.txt' " +
116+
"-not -path '*/vendor/*' " +
117+
"-not -path '*/htmlcov/*' " +
118+
"-not -path '*/home/cainus/*' " +
119+
"-not -path '*/virtualenv/*' " +
120+
"-not -path '*/js/generated/coverage/*' " +
121+
"-not -path '*/.virtualenv/*' " +
122+
"-not -path '*/virtualenvs/*' " +
123+
"-not -path '*/.virtualenvs/*' " +
124+
"-not -path '*/.env/*' " +
125+
"-not -path '*/.envs/*' " +
126+
"-not -path '*/env/*' " +
127+
"-not -path '*/envs/*' " +
128+
"-not -path '*/.venv/*' " +
129+
"-not -path '*/.venvs/*' " +
130+
"-not -path '*/venv/*' " +
131+
"-not -path '*/venvs/*' " +
132+
"-not -path '*/.git/*' " +
133+
"-not -path '*/.hg/*' " +
134+
"-not -path '*/.tox/*' " +
135+
"-not -path '*/__pycache__/*' " +
136+
"-not -path '*/.egg-info*' " +
137+
"-not -path '*/$bower_components/*' " +
138+
"-not -path '*/node_modules/*' " +
139+
"-not -path '*/conftest_*.c.gcov'"
140140
).split(' ')
141+
// winPatterns = (
142+
// '/a:-d /b /s *coverage.* ' +
143+
// '/s nosetests.xml ' +
144+
// '/s jacoco*.xml ' +
145+
// '/s clover.xml ' +
146+
// '/s report.xml ' +
147+
// '/s cobertura.xml ' +
148+
// '/s luacov.report.out ' +
149+
// '/s lcov.info ' +
150+
// '/s *.lcov ' +
151+
// '/s gcov.info ' +
152+
// '/s *.gcov ' +
153+
// '/s *.lst' +
154+
// '| findstr /i /v \\.sh$ ' +
155+
// '| findstr /i /v \\.data$ ' +
156+
// '| findstr /i /v \\.py$ ' +
157+
// '| findstr /i /v \\.class$ ' +
158+
// '| findstr /i /v \\.xcconfig$ ' +
159+
// '| findstr /i /v Coverage\\.profdata$ ' +
160+
// '| findstr /i /v phpunit-code-coverage\\.xml$ ' +
161+
// '| findstr /i /v coverage\\.serialized$ ' +
162+
// '| findstr /i /v \\.pyc$ ' +
163+
// '| findstr /i /v \\.cfg$ ' +
164+
// '| findstr /i /v \\.egg$ ' +
165+
// '| findstr /i /v \\.whl$ ' +
166+
// '| findstr /i /v \\.html$ ' +
167+
// '| findstr /i /v \\.js$ ' +
168+
// '| findstr /i /v \\.cpp$ ' +
169+
// '| findstr /i /v coverage\\.jade$ ' +
170+
// '| findstr /i /v include\\.lst$ ' +
171+
// '| findstr /i /v inputFiles\\.lst$ ' +
172+
// '| findstr /i /v createdFiles\\.lst$ ' +
173+
// '| findstr /i /v coverage\\.html$ ' +
174+
// '| findstr /i /v scoverage\\.measurements\\..* ' +
175+
// '| findstr /i /v test_.*_coverage\\.txt ' +
176+
// '| findstr /i /v \\vendor\\ ' +
177+
// '| findstr /i /v \\htmlcov\\ ' +
178+
// '| findstr /i /v \\home\\cainus\\ ' +
179+
// '| findstr /i /v \\js\\generated\\coverage\\ ' +
180+
// '| findstr /i /v \\virtualenv\\ ' +
181+
// '| findstr /i /v \\virtualenvs\\ ' +
182+
// '| findstr /i /v \\\\.virtualenv\\ ' +
183+
// '| findstr /i /v \\\\.virtualenvs\\ ' +
184+
// '| findstr /i /v \\\\.env\\ ' +
185+
// '| findstr /i /v \\\\.envs\\ ' +
186+
// '| findstr /i /v \\env\\ ' +
187+
// '| findstr /i /v \\envs\\ ' +
188+
// '| findstr /i /v \\\\.venv\\ ' +
189+
// '| findstr /i /v \\\\.venvs\\ ' +
190+
// '| findstr /i /v \\venv\\ ' +
191+
// '| findstr /i /v \\venvs\\ ' +
192+
// '| findstr /i /v \\\\.git\\ ' +
193+
// '| findstr /i /v \\\\.hg\\ ' +
194+
// '| findstr /i /v \\\\.tox\\ ' +
195+
// '| findstr /i /v \\__pycache__\\ ' +
196+
// '| findstr /i /v \\\\.egg-info* ' +
197+
// '| findstr /i /v \\\\$bower_components\\ ' +
198+
// '| findstr /i /v \\node_modules\\ ' +
199+
// '| findstr /i /v \\conftest_.*\\.c\\.gcov '
200+
// ).split(' ')
141201
}
142202

143203
var sendToCodecovV2 = function(
@@ -495,11 +555,11 @@ var upload = function(args, on_success, on_failure) {
495555
} else {
496556
// @TODO support for a root directory
497557
// It's not straightforward due to the nature of the dir command
498-
_findArgs = [root].concat(winPatterns)
558+
_findArgs = [root].concat(patterns)
499559
if (more_patterns) {
500560
_findArgs.concat(more_patterns)
501561
}
502-
_files = execFileSync('dir', _findArgs)
562+
_files = execFileSync('find', _findArgs)
503563
.toString()
504564
.trim()
505565
.split('\r\n')

0 commit comments

Comments
 (0)