1+ const process = require ( 'process' ) ;
2+ const path = require ( 'path' ) ;
13const gulp = require ( 'gulp' ) ;
24const uglify = require ( 'gulp-uglify-es' ) . default ;
35const useref = require ( 'gulp-useref' ) ;
@@ -13,6 +15,15 @@ const testPath = './test/test.js';
1315const coverallsCoverageDirPath = './coverage' ;
1416const coverallsCoverageLcovPath = `${ coverallsCoverageDirPath } /lcov.info` ;
1517const coverallsBinPath = './node_modules/coveralls/bin/coveralls.js' ;
18+ const coverallsCommand = ( process . platform === 'win32' )
19+ // Windows (we have to resolve the paths).
20+ ? `nyc report --reporter=lcov`
21+ + ` && type ${ path . resolve ( coverallsCoverageLcovPath ) } | ${ path . resolve ( coverallsBinPath ) } `
22+ + ` && rmdir /s /q ${ path . resolve ( coverallsCoverageDirPath ) } `
23+ // Linux.
24+ : `nyc report --reporter=lcov`
25+ + ` && cat ${ coverallsCoverageLcovPath } | ${ coverallsBinPath } `
26+ + ` && rm -rf ${ coverallsCoverageDirPath } ` ;
1627
1728gulp . task ( 'default' , ( done ) => gulp . src ( [ observableSlimPath , proxyPath ] )
1829 . pipe ( babel ( {
@@ -35,9 +46,7 @@ gulp.task('test', (done) => gulp.src([testPath])
3546 . on ( 'end' , done )
3647) ;
3748
38- gulp . task ( 'coveralls' , shell . task ( [
39- `nyc report --reporter=lcov && cat ${ coverallsCoverageLcovPath } | ${ coverallsBinPath } && rm -rf ${ coverallsCoverageDirPath } `
40- ] ) ) ;
49+ gulp . task ( 'coveralls' , shell . task ( [ coverallsCommand ] ) ) ;
4150
4251gulp . task ( 'lint' , ( done ) => gulp . src ( [ observableSlimPath , proxyPath , testPath ] )
4352 . pipe ( eslint ( ) )
0 commit comments