vinyl-ftp
vinyl-ftp copied to clipboard
Log Only Printing "CONN"
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'));
});
I am getting the same issue. Nothing uploaded and no error messages or notifications in terminal
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.
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( '/' ) );
});