[FEATURE] Ask for setup if not initialized (#2975)

* [FEATURE] Ask for setup if not initialized

Fixes https://github.com/gopasspw/gopass/issues/2963.

Tested-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* Change default from true to false

Reference: https://github.com/gopasspw/gopass/pull/2975#discussion_r1807806970
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

---------

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun 2024-10-22 11:01:39 +08:00 committed by GitHub
parent 638e577064
commit 45043c9a4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,6 +55,15 @@ func (s *Action) IsInitialized(c *cli.Context) error {
out.Printf(ctx, logo)
out.Printf(ctx, "🌟 Welcome to gopass!")
out.Noticef(ctx, "No existing configuration found.")
contSetup, err := termio.AskForBool(ctx, "❓ Do you want to continue to setup?", false)
if err != nil {
return err
}
if contSetup {
return s.Setup(c)
}
out.Printf(ctx, "☝ Please run 'gopass setup'")
return exit.Error(exit.NotInitialized, err, "not initialized")