Виниловый FTP загрузить конкретный каталог

Я пытаюсь заставить Gulp Vinyl FTP загрузить определенную директорию темы Wordpress, вот команда deploy.

gulp.task('deploy', function() {
    console.log('uploading to server');

    var conn = ftp.create({
        host: '',
        user: '',
        password: '',
        parallel: 3,
        log: gutil.log
    });

    var globs = [
    'wp-content/themes/theme2018/**/*',
    'wp-content/themes/theme2018/*',
        // '**/*',
        // '*',
        // '!node_modules/**',
        // '!node_modules/',
        // '!.env'
    ];

    return gulp.src( globs, { base: '.', buffer: false } )
            .pipe( conn.newer( '/public_html' ) ) // only upload newer files 
            .pipe( conn.dest( '/public_html' ) )
})

После того, как я запускаю команду развертывания, она показывает следующее:

[11:20:34] Using gulpfile D:\Cloud\Work\Website.com\gulpfile.js
[11:20:34] Starting 'deploy'...
uploading to server
[11:20:34] CONN
[11:20:35] READY
[11:20:35] MLSD  /public_html
[11:20:35] Finished 'deploy' after 786 ms

Однако ни один из файлов в каталоге темы не загружается.

Есть идеи, что я делаю не так?

1 ответ

Добавлять base варианты для более новых

.pipe( conn.newer( '/public_html'), { base: '.'})

и ты можешь использовать debug вариант при создании ftp

const gutil = require( 'gulp-util' );
let conn = ftp.create({
    log:        gutil.log,
    debug:      gutil.log
});

И наконец, попробуйте 2 использования dest Insted newer

Другие вопросы по тегам