【问题标题】:Gulp vinyl-ftp newer and different size files does not uploadGulp 乙烯基-ftp 更新和不同大小的文件不会上传
【发布时间】:2015-04-20 18:30:25
【问题描述】:

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

有什么想法吗?

【问题讨论】:

  • 为什么您的远程文件夹在conn.newerOrDifferentSizeconn.dest 调用中不同?
  • 只是为了测试一下

标签: javascript node.js ftp gulp ftp-client


【解决方案1】:

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

如果这不能解决问题,您介意在https://github.com/morris/vinyl-ftp 使用您的完整日志和可能的 FTP 服务器软件打开一个问题吗?那么这可能是一个错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-15
    • 1970-01-01
    • 1970-01-01
    • 2019-03-26
    相关资源
    最近更新 更多