()
| 17 | } |
| 18 | |
| 19 | func (h offlineCommandHandler) Execute() error { |
| 20 | moduleManager := plugin.NewModuleManager(h.Logger) |
| 21 | status, err := moduleManager.Offline() |
| 22 | _, _ = fmt.Fprint(h.StdOut, status+"\n\n") |
| 23 | if err == nil { |
| 24 | _, err := fmt.Fprint(h.StdOut, "Successfully downloaded all modules for offline mode!") |
| 25 | return err |
| 26 | } |
| 27 | return fmt.Errorf("Failed to download modules required for offline mode: %w", err) |
| 28 | } |
| 29 | |
| 30 | func newOfflineCommandHandler(stdOut io.Writer, logger log.Logger) *offlineCommandHandler { |
| 31 | return &offlineCommandHandler{stdOut, logger} |
nothing calls this directly
no test coverage detected