Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The init command doesn't fail immediately if store is already initialized #15

@kpitt

Description

@kpitt

Summary

When running init on an already-initialized store, it immediately reports that the store is already initialized, but the command doesn't fail until after the user selects the GPG key to use.

Steps To Reproduce

  1. Initialize the root password store with gopass init
  2. Run gopass init a second time

Expected behavior

The command should detect an already-initialized store and fail immediately. It should not prompt the user for additional information that will never be used.

Additional context

The second gopass init command produces the following output:

Initializing a new password store:

✗ Store is already initialized!
- Searching for usable private keys...
! Hint: Use 'gopass init <subkey> to use subkeys!'
? Please select a private key for encrypting secrets:
[...]
Please enter the number of a key (0-2, [q]uit) (q to abort) [0]: 2

Error: Failed to initialize store: failed to init store "" at "~/.local/share/gopass/stores/root": failed to initialize new sub store: found already initialized store at "~/.local/share/gopass/stores/root".
You can add secondary stores with 'gopass init --path <path to secondary store> --store <mount name>'
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions