Closed tegefaulkes closed 3 weeks ago
UNIX mkdir
doesn't stop on error. It keeps going, making what directories it can make, leaving what it cannot. I think that instead of returning an ENOENT
or other error, it should catch it, and ignore it, returning an error string that can be printed out instead.
Currently, we just return a success message. Instead of that, we can use duplex streaming to return an error message or success flag every time a directory is created, or we can accumulate the errors and return them in one large chunk at the end of the whole process.
I would also need to make a new vaultOps
for returning an error string instead of throwing an error, so if one path is invalid in multiple vaults, it won't stop creating more paths, but return an error string instead, and continue. Either this, or I can implement a flag to continue on errors in the existing vaultOps.mkdir
.
I need some inputs on this.
Go with the duplex method then. Keep in mind that you may need to support making directories across multiple vaults at once. And multiple directories in a single vault must be done in a single commit in the vault. That will affect how you implement things.
Go with the duplex method then. Keep in mind that you may need to support making directories across multiple vaults at once. And multiple directories in a single vault must be done in a single commit in the vault. That will affect how you implement things.
Yes, I am taking inspiration from how I handled this in VaultsSecretsRemove
to delete files from all vaults in a single commit.
Specification
secrets mkdir
is pretty simple, it will create a directory at the specified paths.ENOENT
-p
is specified then it will create missing parent directories.Additional context
Related #32
Tasks
secrets mkdir
command-p
flag for recursively creating directories.