Gulp乙烯基ftp更新和不同大小的文件不上传

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

本文关键字:文件 乙烯基 ftp 更新 Gulp      更新时间:2024-02-12

乙烯基ftp具有此功能,可以上传新的和不同大小的文件conn.differentSize(remoteFolder[,options])

我试图测试只有更新的文件才会上传,但到目前为止什么都没有发生,只是文件没有上传。这是我的配置。

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') );} );

有什么想法吗?

正如Heikki所指出的,远程路径必须相同;否则newerOrDifferentSize会将images/foo.pngtest2/images/foo.png进行比较,然后确定上传到test/images/foo.png

如果这还不能解决问题,你介意在https://github.com/morris/vinyl-ftp你的完整日志,可能还有你的FTP服务器软件?这可能是一个错误。