Commands fail when currentvault names no vault (closes #156)
check / check (push) Waiting to run
check / check (push) Waiting to run
An empty currentvault, or one naming a vault that does not exist, made `secret list` report an empty vault with exit 0 and `secret add` fail on a missing directory. ResolveVaultSymlink now refuses an empty or invalid name, or one with no directory under vaults.d, with an error that wraps ErrVaultNotFound, names the file and says to run `secret vault select <name>`. Every command that uses the current vault gets it; `secret vault list` still lists the vaults. newSizeTestVault wrote a full path into currentvault, which resolved only because the last path element was taken as the name; it now relies on CreateVault selecting the vault. Model: opus-5-5
This commit is contained in:
@@ -114,7 +114,10 @@ are allowed, and a name must not be empty, `.` or `..`.
|
||||
|
||||
#### `secret vault select <name>`
|
||||
|
||||
Switches to the specified vault for subsequent operations.
|
||||
Switches to the specified vault for subsequent operations. When `currentvault`
|
||||
is empty or names a vault that does not exist, every command that uses the
|
||||
current vault fails with an error that names the file and says to run
|
||||
`secret vault select <name>`; `secret vault list` still lists the vaults.
|
||||
|
||||
#### `secret vault remove <name> [--force]` / `secret vault rm` ⚠️ 🛑
|
||||
|
||||
|
||||
Reference in New Issue
Block a user