Open mojavelinux opened 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.
If we decide to make this an option, we need to agree on the name. Perhaps something as simple as mkdirs: true
.
The dest
command work as like as gulp.dest.
The sftp
command should work as like as ssh2's sftp command.
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.
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.