vinyl-ftp icon indicating copy to clipboard operation
vinyl-ftp copied to clipboard

Log Only Printing "CONN"

Open ava-cassiopeia opened this issue 7 years ago • 3 comments

Whenever I try to use this, my log only prints as follows:

[11:47:50] CONN 
[11:47:50] CONN 
[11:47:50] CONN 
[11:47:50] CONN 
[11:47:50] CONN 

In addition, the upload doesn't seem to actually work; I don't see anything appearing on my remote server.

If you could help with what I'm doing wrong, that would be awesome.

Gulpfile (relevant code)

gulp.task("deploy", ["build-css"], function() {
    var config = require("./ftp-config.json");

    var connection = ftp.create({
        host: config.host,
        user: config.user,
        password: config.pass,
        port: config.port,
        parallel: 10,
        log: gutil.log
    });

    var globs = [
        '**/*.css'
    ];

    var upload = connection.upload;
    connection.upload = function(file, path, cb) {
        if (!file.isNull()) console.log(file, path); // use file and path for something
        upload.call(this, file, path, cb);
    };

    return gulp.src(globs, {base: '.', buffer: false})
		.pipe(connection.newer('/wp-content')) // only upload newer files
		.pipe(connection.dest('/_ftptest'));
});

ava-cassiopeia avatar Mar 29 '17 17:03 ava-cassiopeia

I am getting the same issue. Nothing uploaded and no error messages or notifications in terminal

swightwick avatar Jul 25 '18 09:07 swightwick

I guess this happens because the config variable has not been defined at the point when you call ftp.create. You can check this by calling console.log(connection) after its definition and check if host, user and password were ever set correctly.

At least this was the case with me.

silllli avatar Sep 23 '18 13:09 silllli

Getting the same issue. All config variables are set properly.

gulp.task('deploy', ['styles', 'scripts'], function(){
    var conn = ftp.create( {
       host: host,
       user: user,
       port: port,
       password: pass,
       parallel: 10,
       reload: true,
       log: gutil.log,
    });

    var globs = [
        '../wp-content/themes/' + themeFolder + '/style.css'
    ];

    return gulp.src( globs, { base: '.', buffer: false } )
        .pipe( conn.newer( '/wp-content/themes/' + themeFolder + '/style.css' ) )
        .pipe( conn.dest( '/' ) );

});

talymo avatar Dec 10 '19 18:12 talymo