When writing to a directory, the command should provide appropriate feedback bail out. This should either be done immediately (by preemptively checking if the target is a valid file path or not), or later, by raising an appropriate error.
Currently, it just returns this output, which is not really explicit or apparent in what went wrong:
[aryanj@matrix-34xx:~]$ pk secrets write vault:dir
writing to dir <Ctrl-D>
undefined
[aryanj@matrix-34xx:~]$ echo $?
255
To Reproduce
Try writing to a directory using stdin
Observe issue
Expected behavior
As in secrets cat, an error could be raised:
[aryanj@matrix-34xx:~]$ pk secrets cat vault:dir
ErrorSecretsIsDirectory: dir: Is a directory
A similar behaviour is seen when trying to remove the vault root using secrets rm. It just prints undefined and fails. Doing this should yield a proper error message.
Describe the bug
When writing to a directory, the command should provide appropriate feedback bail out. This should either be done immediately (by preemptively checking if the target is a valid file path or not), or later, by raising an appropriate error.
Currently, it just returns this output, which is not really explicit or apparent in what went wrong:
To Reproduce
Expected behavior
As in
secrets cat
, an error could be raised:Screenshots
Platform
["0.10.0","1.14.0","1","1"]
Additional context
Notify maintainers
@aryanjassal