{"action":"created","issue":{"url":"https://api.github.com/repos/gtg092x/gulp-sftp/issues/34","repository_url":"https://api.github.com/repos/gtg092x/gulp-sftp","labels_url":"https://api.github.com/repos/gtg092x/gulp-sftp/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/gtg092x/gulp-sftp/issues/34/comments","events_url":"https://api.github.com/repos/gtg092x/gulp-sftp/issues/34/events","html_url":"https://github.com/gtg092x/gulp-sftp/issues/34","id":88027419,"number":34,"title":"gulp-sftp trying to upload directories","user":{"login":"saschabratton","id":12237506,"avatar_url":"https://avatars.githubusercontent.com/u/12237506?v=3","gravatar_id":"","url":"https://api.github.com/users/saschabratton","html_url":"https://github.com/saschabratton","followers_url":"https://api.github.com/users/saschabratton/followers","following_url":"https://api.github.com/users/saschabratton/following{/other_user}","gists_url":"https://api.github.com/users/saschabratton/gists{/gist_id}","starred_url":"https://api.github.com/users/saschabratton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saschabratton/subscriptions","organizations_url":"https://api.github.com/users/saschabratton/orgs","repos_url":"https://api.github.com/users/saschabratton/repos","events_url":"https://api.github.com/users/saschabratton/events{/privacy}","received_events_url":"https://api.github.com/users/saschabratton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-13T16:12:49Z","updated_at":"2016-03-06T18:12:38Z","closed_at":null,"body":"I am using `gulp-sftp` to deploy website changes. It functions as a `post-merge` git hook.\r\n\r\nSo, 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.\r\n\r\nIt's pretty simple right now: the changed files are separated with `gulp-changed` and moved to a \"build\" directory and then uploaded with `gulp-sftp`.\r\n\r\nMy deployment task looks like this:\r\n````javascript\r\ngulp.task('deploy', function() {\r\n\treturn gulp.src(src)\r\n\t.pipe(changed(dest))\r\n\t.pipe(gulp.dest(dest))\r\n\t.pipe(sftp({\r\n\t  host: 'ftp.example.com',\r\n\t  user: 'username',\r\n\t  pass: 'password',\r\n\t  remotePath: '/htdocs/'\r\n\t}));\r\n});\r\n````\r\n\r\nThis 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.\r\n\r\nHere is an example of the output I am seeing:\r\n\r\n````\r\n[11:53:19] Using gulpfile /foo/bar/gulpfile.js\r\n[11:53:19] Starting 'deploy'...\r\n[11:53:20] Authenticating with password.\r\n[11:53:21] SFTP error or directory exists: Error: File already exists. /htdocs/Foo\r\n[11:53:21] SFTP error or directory exists: Error: File already exists. /htdocs/Foo/Bar\r\n[11:53:22] gulp-sftp: Uploaded: Foo/Bar/example.html => Foo/Bar/example.html\r\n[11:54:11] gulp-sftp: 1 file uploaded successfully\r\n[11:54:11] SFTP :: SFTP session closed\r\n[11:54:11] Finished 'deploy' after 52 s\r\n[11:54:11] Connection :: end\r\n[11:54:11] Connection :: close with error\r\n````\r\n\r\nIs 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?"},"comment":{"url":"https://api.github.com/repos/gtg092x/gulp-sftp/issues/comments/192952288","html_url":"https://github.com/gtg092x/gulp-sftp/issues/34#issuecomment-192952288","issue_url":"https://api.github.com/repos/gtg092x/gulp-sftp/issues/34","id":192952288,"user":{"login":"Saturate","id":453018,"avatar_url":"https://avatars.githubusercontent.com/u/453018?v=3","gravatar_id":"","url":"https://api.github.com/users/Saturate","html_url":"https://github.com/Saturate","followers_url":"https://api.github.com/users/Saturate/followers","following_url":"https://api.github.com/users/Saturate/following{/other_user}","gists_url":"https://api.github.com/users/Saturate/gists{/gist_id}","starred_url":"https://api.github.com/users/Saturate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Saturate/subscriptions","organizations_url":"https://api.github.com/users/Saturate/orgs","repos_url":"https://api.github.com/users/Saturate/repos","events_url":"https://api.github.com/users/Saturate/events{/privacy}","received_events_url":"https://api.github.com/users/Saturate/received_events","type":"User","site_admin":false},"created_at":"2016-03-06T18:12:38Z","updated_at":"2016-03-06T18:12:38Z","body":"This has annoyed me as well, not sure on how to fix it. If someone has a suggestion I could do a PR."}}