gtg092x / gulp-sftp

Gulp SFTP Deploy
140 stars 61 forks source link

remote directory create does not work, if remotepath startswith / (win) #10

Closed danimajo closed 10 years ago

danimajo commented 10 years ago

If you have a remotePath configured with an heading slash (absolute dir) and you are on windows (client), the dirs are not created (heading slash is somewhere trimmed...)

danimajo commented 10 years ago

I think it is in parents, since parents tries to identify the os (which in the client case is windows), but target is something else

I tried to fix this, giving parents:

var fileDirs = parents(dirname,{platform:'unix'})

this works, but not in all cases (if you have sub-sub dirs with empty dirs, there is also an error)

I will try to provide a pull request, but I maybe need some time for this ...

gtg092x commented 10 years ago

Thanks for the clear steps to recreate. I'll see if there's anything on this side that can address it.

akdjr commented 10 years ago

I encountered this same issue as well and just used a temporary hack to get this working for me. I don't know where that heading forward slash is getting trimmed (as I unfortunately don't have the time yet), so i just add the forward slash back to the beginning of the path if it's not there. Obviously this is not a catch all fix, but in my environment (windows client, linux remote) it works well enough for my purposes.

Added after Line 254

if (d[0] != '/') {
  d = '/' + d;
}
marcallkz commented 10 years ago

I had this issue too.

Solved it by creating a fork (https://github.com/marcallkz/gulp-sftp) and replacing the 'parents' module with a simpler one I created just to break the path at the slashes.

The module I've created is at https://github.com/marcallkz/pathwalker

davismj commented 10 years ago

I've also had this issue.

gtg092x commented 10 years ago

Guys, a PR would have been appreciated. 1da970e0170f0a32e0adebb5e94667c0afc990d5 should take care of your issue. I'm publishing the update now.

@marcallkz - please post a PR next time. npm won't see your repo and it takes the same work to merge your changes in.

davismj commented 10 years ago

Still having the issue.