gulpjs/vinyl

[Question] How to create a filter which only uploads different size or non existing files?

nealoke opened this issue · 1 comments

I've tried creating this but I'm really not familiar with fs or other native node modules. I've tried something like this but it is not working.

gulp.task('deploy:test', () => {
	const conn = ftp.create(ftpConfig);
	return gulp.src(`${paths.dist}**/*`, { base: './dist/', buffer: false }).pipe(conn.filter(domains.test, (local, remote, cb) => {

		if (!remote) {
			cb(null, local);
		}

		else if (local.stat.mtime > remote.ftp.date || local.stat.size !== remote.ftp.size) {
			cb(null, local);
		}
	}));
});

This is not a support forum. Please direct support questions to StackOverflow.