Search code examples
javascriptnode.jsftpgulpftp-client

Gulp vinyl-ftp newer and different size files does not upload


vinyl-ftp has this feature to upload new and different size files conn.differentSize( remoteFolder[, options] )

I am trying to test that only newer files would upload and so far nothing is happening, files just are not uploading. Here my configuration.

gulp.task( 'deploy', function() {

var conn = ftp.create( {
    host:     hostremote,
    user:     userremote,
    password: passremote,
    parallel: 10,
    log:true
} );

var globs = [
    '*',
    'build/**',
    'dist/**',
    'fonts/**',
    'html/**',
    'IE6/**',
    'images/**',
    'include/**',
    'js/**',
    'language/**',
    'lib/**',
    '!node_modules',
    '!original',
    '!node_modules/**',
    '!original/**'


];

// using base = '.' will transfer everything to /public_html correctly 
// turn off buffering in gulp.src for best performance 

return gulp.src( globs, { base: '.', buffer: false } )
    .pipe( conn.newerOrDifferentSize( '/test2' ) )
      .pipe( conn.dest('/test') );} );

Any thoughts ?


Solution

  • As Heikki points out, the remote paths must be the same; otherwise newerOrDifferentSize will compare images/foo.png with test2/images/foo.png, and then definitely upload to test/images/foo.png.

    If that does not fix it, would you mind opening an issue at https://github.com/morris/vinyl-ftp with your full log, and possibly your FTP server software? This might be a bug then.