teambition / gulp-ssh

SSH and SFTP tasks for gulp
184 stars 38 forks source link

Add "dest" method that behaves similarly to standard gulp dest #22

Closed davidvedvick closed 9 years ago

davidvedvick commented 9 years ago

Added a "dest" method that will behave similarly to the standard gulp dest, based off the sftp('write') method. It will automatically attempt to create folders that don't exist and push according to the glob passed in.

Potential usage: I've been using this to "deploy" my app to a server, like so:

gulp.task('publish-content', ['build-static'], function() {
    return gulp
        .src('./public/**/*')
        .pipe(gulpSsh.dest('/home/protected/app/public/'));
});

Hope you guys find it interesting and/or useful!

zensh commented 9 years ago

Hi, you should rebase master for "standard coding style". It need a simple test case yet. Thank you for your PR.

davidvedvick commented 9 years ago

Hi zensh, I will try to get that tomorrow and re-submit it.

davidvedvick commented 9 years ago

Hi zensh, I updated to match your standards (lack of ';' is interesting). I also added a test and updated the test to use a JSON file for configuration if it exists, so that others can run tests easily.

Let me know if you need anything else changed.

davidvedvick commented 9 years ago

Also - I did some research and there is another project - gulp-sftp, that may already have this functionality, but I haven't tested it yet. That may just be the way to go, if you want to keep the scope of this plug-in smaller.

Thanks