1package action 2 3import ( 4 "fmt" 5 "runtime" 6 7 "github.com/gopasspw/gopass/internal/out" 8 "github.com/gopasspw/gopass/internal/updater" 9 "github.com/gopasspw/gopass/pkg/ctxutil" 10 11 "github.com/urfave/cli/v2" 12) 13 14// Update will start the interactive update assistant 15func (s *Action) Update(c *cli.Context) error { 16 s.rem.Reset("update") 17 18 ctx := ctxutil.WithGlobalFlags(c) 19 20 if s.version.String() == "0.0.0+HEAD" { 21 out.Errorf(ctx, "Can not check version against HEAD") 22 return nil 23 } 24 25 if runtime.GOOS == "windows" { 26 return fmt.Errorf("gopass update is not supported on windows (#1722)") 27 } 28 29 out.Printf(ctx, "⚒ Checking for available updates ...") 30 if err := updater.Update(ctx, s.version); err != nil { 31 return ExitError(ExitUnknown, err, "Failed to update gopass: %s", err) 32 } 33 34 out.OKf(ctx, "gopass is up to date") 35 return nil 36} 37