m19c / gulp-run

Pipe to shell commands in gulp
ISC License
151 stars 25 forks source link

Error when using merge-stream #31

Open Jenselme opened 9 years ago

Jenselme commented 9 years ago

I am trying to concatenate the output of gulp-run with files coming from gulp.src. To do this, I use merge-stream and gulp-concat. I get the following error:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Streaming not supported

If I remove .exec(), I don't have the error but no file is created (I find this logically according to the documentation). If I use gulp-shell instead everything is fine.

Here is my task:

var merge = require('merge-stream');
var concat = require('gulp-concat');

gulp.task('build.js', ['js-files'], function () {
    var jsFiles = fs.readFileSync('/tmp/geo-front3/js-files')
        .toString()
        .replace('\n', ' ');

    var appJs = run('closure-compiler ' +
    jsFiles  +
    '--compilation_level SIMPLE_OPTIMIZATIONS ' +
    '--jscomp_error checkVars ' +
    '--externs externs/ol.js ' +
    '--externs externs/angular.js ' +
    '--externs externs/jquery.js ').exec();

    var libSrc = gulp.src([
        'src/lib/jquery-2.0.3.min.js',
        'src/lib/bootstrap-3.3.1.min.js',
        'src/lib/moment-with-customlocales.min.js',
        'src/lib/typeahead-0.9.3.min.js src/lib/angular.min.js',
        'src/lib/proj4js-compressed.js',
        'src/lib/EPSG*.js',
        'src/lib/ol.js',
        'src/lib/angular-translate.min.js',
        'src/lib/angular-translate-loader-static-files.min.js',
        'src/lib/fastclick.min.js',
        'src/lib/localforage.min.js',
        'src/lib/filesaver.min.js',
    ]);

    merge(libSrc, appJs)
        .pipe(concat('build.js'))
        .pipe(gulp.dest('prd/lib'));
});
bezenson commented 8 years ago

Have you resolved it somehow? I have the same problem

Jenselme commented 8 years ago

@inferusvv I haven't. I changed how our build process works to avoid the problem.

craigmdennis commented 8 years ago

Also getting this issue with no clear reason in the NPM logs