This code will pipe only new added and changed files to gulp-sftp
. No need for extra modules.
Created
March 17, 2017 09:17
-
-
Save secelite/271004eeb9698ac3d44f162fb2842919 to your computer and use it in GitHub Desktop.
Transfer only added & changed files with `gulp` & `gulp-sftp`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment