Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save secelite/271004eeb9698ac3d44f162fb2842919 to your computer and use it in GitHub Desktop.
Save secelite/271004eeb9698ac3d44f162fb2842919 to your computer and use it in GitHub Desktop.
Transfer only added & changed files with `gulp` & `gulp-sftp`
gulp.task("watch-upload", function() {
gulp.watch("src/**/*", function(obj) {
if(["changed", "added"].indexOf(obj.type) !== -1) {
gulp.src(obj.path, {"base": "src/"})
.pipe(sftp(config.sftp));
}
});
});

Transfer only added & changed files with gulp & gulp-sftp

This code will pipe only new added and changed files to gulp-sftp. No need for extra modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment