Open te-gpm opened 9 years ago
+1 or at least the possibility to overwrite folders would be awesome.
I ended up using gulp-rsync which supports a clean parameter that will delete files not included in the synced folder. https://www.npmjs.com/package/gulp-rsync
I'm missing an option to store credentials in a separate file, but maybe this will be included in gulp-sftp in the future :)
Thx @te-gpm , rsync isn't an option for me because I use a shared hosting environment which doesn't offer rsync.
Hey all - I'm being a bad project maintainer here. I'm hesitant to dive into the feature because mistakes can end up deleting valuable assets (extra paranoid). Can I get anyone to help with its development? I'd be happy to make the change if someone can pull the branch and test it with me.
Hey gtg092x, unfortunately I'm pretty swamped right now, so I won't be able to help with development, but I'd be happy to help testing on a VM if you were to develop this feature :) Just drop me a line or post here if I can be of assistance.
+1! I'd also be happy to help @gtg092x. Assuming I have the time when you drop me a line. And I', using it currently, do.. Otherwise @te-gpm might have some time then.
Great work with this repo!
@te-gpm actually you can put the credentials in a different file already.
Create a file called .sftppass.json
(or whatever you prefer) in the same dir where your gulpfile.js
resides and put your credentials inside it, like this:
{
"host": "yourhost",
"user": "youruser",
"pass": "yourpass"
}
then use it in your gulpfile.js
, like this:
var gulp = require('gulp');
var sftp = require('gulp-sftp');
var sftppass = require('./.sftppass.json');
gulp.task('default', function () {
return gulp.src('src/*')
.pipe(sftp(sftppass));
});
also you can ignore .sftppass.json
in your version system to commit your gulfile.js
without distributing your credentials around
@gtg092x I'm also interested in cleaning the remote dir (or move it to a backup location) and I can help you out in trying this, I'm extra paranoid too so don't worry: even if we end up deleting some precious asset I definitely have it backuped somewhere :)
Maybe a good approach to this kind of things is having the ability to forward some command directly without a prebuilt method, something like the .ssh()
, .sftp()
or .shell()
of this module: https://github.com/teambition/gulp-ssh so the advanced user can do almost everything and is responsible of his/her actions.
+1
+1
@gtg092x are you still on this project?
I was experiencing this issue and some others, moved to gulp-rsync
and it works much better. Just my 2 cents.
@TCB13 yes, gulp-rsync
works very well but, alas, I don't have rsync
available in every environment I have the pleasure to work on :)
@kaosmos I'm going plain old FTP when that happens. Seems to be the only viable option right now. Unfortunately. :(
yes and further it seems that @gtg092x has abandoned this package
+1
I have implemented it in Pull Request #73
Thanks for having implemented this feature, I was looking to it. @gtg092x can you please review and merge. Otherwise we can publish a fork with a different name
Without a clean method, this is not useable in the real world.
Hi All,
I published gulp-sftp-clean on NPM which contains the code from @rudchenkos I am using it and it does the job
Regards
Sounds great @krysalead!
I'm using gulp-sftp to upload the current state of a project to a staging server. Is it possible to clean (e.g. delete all content) of the target folder on the remote machine before uploading? Since I have a lot of changing files and file structures the target folder gets extremely cluttered with files that have since been moved, renamed or deleted.