Closed saschabratton closed 7 years ago
Looking at the code, expected behaviour.
That being said, I think the code could be enhanced to keep a list of dir already created as we loop, check this list on error and only report error for true ftp error. There's certainly more efficient ways to do it (prune upfront) but that would require more work.
This has annoyed me as well, not sure on how to fix it. If someone has a suggestion I could do a PR.
Although the "Known Issues" suggest that for Windows this should be fixed in 0.1.3, I'm still getting this (on Windows) in 0.1.5
@toby1kenobi I believe the issue you are referring to is: https://github.com/gtg092x/gulp-sftp/issues/16
I believe that issue is resolved, and while the error message thrown for that issue came from the same call site as this issue, they are not the same issue.
Proposed solution: https://github.com/gtg092x/gulp-sftp/pull/61
Looks like there's a couple PR aimed at this issue, but attempting to actually check whether a directory exists or not. Not sure if they are good solutions or not.
My proposed solution simply suppresses the error for existing directories. So there is some overhead because the mkdir
commands are still sent.
This solution works for my purposes.
Looks like this was fixed in #39 using an undocumented exists()
method on the SFTPStream.
Nice find, @hussion!
I am using
gulp-sftp
to deploy website changes. It functions as apost-merge
git hook.So, changes to the website are committed and pushed to our git repo. Then for deployment, a server runs
git pull
to grab all the changes and then they are run thru gulp.It's pretty simple right now: the changed files are separated with
gulp-changed
and moved to a "build" directory and then uploaded withgulp-sftp
.My deployment task looks like this:
This works just fine; however, the gulp deployment task is throwing a lot of errors because it is apparently trying to create the directories that the changed files are in. It can become a bit confusing to parse out the real output to confirm that changes were deployed properly, because of all the noise from directory errors, especially with deeply nested directories.
Here is an example of the output I am seeing:
Is there an option or configuration that I have overlooked? Or is this problem related to the way I am using
gulp-changed
and I should be talking to that group?