Open tegefaulkes opened 4 months ago
I want to point out that cp
here is going to be one of the most complex commands and most used commands probably.
You have consider these scenarios:
secrets cp ./a ./b
could this just run as usual?Then imagine that all works also recursively.
Yeah, it's a complex and I've considered most of that already.
I think the most complex part of this is the recursive walking and globing of the file paths. I've already completed a utility for this in https://github.com/MatrixAI/Polykey/issues/767 which works on real fs along with our fs. It supports the whole glob standard using minimatch
which is what NPM uses to check glob patterns.
Along with that there's sending the file tree across the network so we can write it between the real FS locally and the node's efs. I'm half way through this now with https://github.com/MatrixAI/Polykey/pull/774.
Besides that I still need to work out how I want to structure the RPC commands. If we say, want a specilized RPC for CP, or more generalised RPC for plumbing. I need to do some prototyping to get an idea of the constraints. The plumbing style might require the ability to lock and hold transactions between RPC calls.
Specification
The
secrets cp
command is very similar to thesecrets mv
command. It will copy the provided paths to the provided destination.There are two main differences between the
mv
command.So there are no subtle behaviours with the moving the file vs copying them between filesystems.
Additional context
Related #32
Tasks
secrets cp
command