zhevron / gulp-deploy-git

Deploy Gulp builds automatically to a Git repository.
https://www.npmjs.org/package/gulp-deploy-git
MIT License
26 stars 6 forks source link

Deploy fails : Buffers are not supported #5

Closed Fanaen closed 8 years ago

Fanaen commented 8 years ago

When using gulp-deploy-git with the default task desploy, an Error: Buffers are not supported occured in the gulp workflow. I'm trying to run the tool in the following environment:

The corresponding gulpfile.js:

var gulp = require('gulp');
var deploy = require('gulp-deploy-git');

gulp.task('deploy', function() {
  return gulp.src('dist/**/*')
    .pipe(deploy({
      repository: 'http://gitlab.example.com:20000/username/gdg-test.git',
      verbose: true,
      debug: true
    }));
});

And the result:

C:\Users\Elouan\Labo\gdg-test>gulp deploy
[10:23:02] Using gulpfile ~\Labo\gdg-test\gulpfile.js
[10:23:02] Starting 'deploy'...
[10:23:02] 'deploy' errored after 18 ms
[10:23:02] Error: Buffers are not supported
    at formatError (C:\Users\Elouan\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:169:10)
    at Gulp.<anonymous> (C:\Users\Elouan\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:195:15)
    at emitOne (events.js:90:13)
    at Gulp.emit (events.js:182:7)
    at Gulp.Orchestrator._emitTaskDone (C:\Users\Elouan\Labo\gdg-test\node_modules\orchestrator\index.js:264:8)
    at C:\Users\Elouan\Labo\gdg-test\node_modules\orchestrator\index.js:275:23
    at finish (C:\Users\Elouan\Labo\gdg-test\node_modules\orchestrator\lib\runTask.js:21:8)
    at DestroyableTransform.<anonymous> (C:\Users\Elouan\Labo\gdg-test\node_modules\orchestrator\lib\runTask.js:52:4)
    at DestroyableTransform.f (C:\Users\Elouan\Labo\gdg-test\node_modules\once\once.js:17:25)
    at emitOne (events.js:95:20)

Is that the error mentionned in the README?

zhevron commented 8 years ago

My bad, documentation forgot the { read: false } argument to gulp.src

The correct task should be:

var gulp = require('gulp');
var deploy = require('gulp-deploy-git');

gulp.task('deploy', function() {
  return gulp.src('dist/**/*', { read: false })
    .pipe(deploy({
      repository: 'http://gitlab.example.com:20000/username/gdg-test.git',
      verbose: true,
      debug: true
    }));
});
Fanaen commented 8 years ago

This solves the issue. Thanks for the quick answer!