fix(GODT-2277): Fix keychains initialisation in vault-editor (for write as well).

This commit is contained in:
Romain LE JEUNE
2023-11-13 15:37:32 +01:00
parent 159e1cee7d
commit ea26188dc0

View File

@ -65,15 +65,17 @@ func readAction(c *cli.Context) error {
func writeAction(c *cli.Context) error {
return app.WithLocations(func(locations *locations.Locations) error {
return app.WithVault(locations, nil, async.NoopPanicHandler{}, func(vault *vault.Vault, insecure, corrupt bool) error {
b, err := io.ReadAll(os.Stdin)
if err != nil {
return fmt.Errorf("failed to read vault: %w", err)
}
return app.WithKeychainList(func(keychains *keychain.List) error {
return app.WithVault(locations, keychains, async.NoopPanicHandler{}, func(vault *vault.Vault, insecure, corrupt bool) error {
b, err := io.ReadAll(os.Stdin)
if err != nil {
return fmt.Errorf("failed to read vault: %w", err)
}
vault.ImportJSON(b)
vault.ImportJSON(b)
return nil
return nil
})
})
})
}