alexshevch / cordova-auto-patch

Automatically increment patch version in config.xml
MIT License
3 stars 0 forks source link

TypeError: dest.on is not function #2

Open djtregear opened 8 years ago

djtregear commented 8 years ago

Hi

After installing xml2js as a dev dependency of my project I ran using a very simple setup as a gulp file.

gulp.task('patch', function() {
  gulp.src('./')
    .pipe(patch('./'))
    .pipe(gulp.dest('./'));
});

This created the following error, although the patch did actually work...

[11:32:21] TypeError: dest.on is not a function
    at DestroyableTransform.Readable.pipe (/Users/djtregear/Documents/Foundry/knowDiddly/apiDiddly/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:516:8)
    at Gulp.<anonymous> (/Users/djtregear/Documents/Foundry/knowDiddly/apiDiddly/gulpfile.js:524:6)
    at module.exports (/Users/djtregear/Documents/Foundry/knowDiddly/apiDiddly/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/Users/djtregear/Documents/Foundry/knowDiddly/apiDiddly/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/Users/djtregear/Documents/Foundry/knowDiddly/apiDiddly/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/Users/djtregear/Documents/Foundry/knowDiddly/apiDiddly/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
    at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)
    at Function.Module.runMain (module.js:443:11)
    at startup (node.js:139:18)
    at node.js:968:3
Build version: 0.4.21
alexshevch commented 8 years ago

Hi djtregear,

Thank you for creating this issue. The problem here is that .pipe(patch('./')) does not return a proper gulp stream, required by gulp.dest. I am going to add it in the next minor version, and for now please use any other cordova module to pass the config file to a destination folder, as shown on the example here.