Comments (5)
I think I'd prefer to leave that to userland to implement something like that. From my experience, convenience features like these typically end up being highly opinionated and I try to keep the module's focus on getting the core/less opinionated things right.
from ssh2-streams.
Ok. thanks.
from ssh2-streams.
@mscdex I looked a bit harder at this and my preference is to modify the behavior of fastPut
that way I only need to implement the rename in one place (as putDirectory, etc all use it underneath the hood). Unfortunately, I didn't find a good mechanism to intercept the behavior, so I did it this way via a monkey patch: https://github.com/garygrossgarten/github-action-scp/blob/09a05dd06e8768d1327f701ef081f6f063834c3b/src/index.ts#L25
Generally speaking it seems that monkey patching is discouraged in Javascript, but there doesn't seem to be a hooking mechanism to insert the rename in there. Did I miss something? Would you be willing to insert a hook for this sort of thing, or do you think the monkey patching is fine.
Thanks! We've found this library (indirectly) to be really useful for automating our builds, I'm glad it exists. :)
from ssh2-streams.
There is no hooking mechanism. A better alternative would be to just make it a new function (not on the prototype of course) instead of overwriting the existing fastPut()
and have your application use that instead 🤷♂️
from ssh2-streams.
Well, but then I'd have to copy and change the massive bit of code that involved putting a directory, in addition to the file putting code....
Oh, I see! 🤦 I had thought putDirectory
was in this library, but it's in node-ssh. I'll make a different issue there.
from ssh2-streams.
Related Issues (20)
- Whats the date for new release with the last fix?
- Bug in flagsToString()
- OpenSSH private keys not decoded correctly HOT 2
- realPath platform inconsistency HOT 2
- Packet transform errors kill the server HOT 1
- 怎么使用这个连接ssh呢?
- Unnecessary components are included in final module bundle HOT 1
- Signature verification failed HOT 21
- "Missing file segements in upload" error when using Fast Put HOT 5
- Impact of Node V14 HOT 1
- Uploaded files are empty HOT 1
- SIGNREQUEST output in Jest HOT 5
- fastXfer: Transferring 0 byte file
- Is there a way to send a message to Client to stop sending data while uploading files?
- Max identification string size exceeded
- Unable to get file from sftp server
- Server welcome message breaks connection ("Error: Unexpected packet before version")
- the difference between ssh2 and ssh2-streams? HOT 1
- Update dependency on streamsearch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssh2-streams.