teambition / gulp-ssh

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

sftp write command not create interim directories #82

Open mojavelinux opened 6 years ago

mojavelinux commented 6 years ago

The sftp write command does not create interim missing directories. The dest command, on the other hand, does create them. I think the commands should be consistent, or there should be an option to control this behavior in both cases. Either way, I don't think the two commands should behave differently.

mojavelinux commented 6 years ago

I'd be happy to take this one on. I'll also add a test to verify the behavior of sftp write in both scenarios.

mojavelinux commented 6 years ago

If we decide to make this an option, we need to agree on the name. Perhaps something as simple as mkdirs: true.

zensh commented 6 years ago

The dest command work as like as gulp.dest.

The sftp command should work as like as ssh2's sftp command.

mojavelinux commented 6 years ago

I see what you're saying. But I don't think the user of this library should have to be aware of the details of how ssh2 works. I could be okay with the current behavior as a default, as long as there is a way to enable making the directories. Having to stop a stream to make directories using a separate call would really disrupt the flow and elegance of the application code.