(cacheImpl *config.CacheImpl)
| 30 | } |
| 31 | |
| 32 | func NewCacheCleanupSubcommand(cacheImpl *config.CacheImpl) *cobra.Command { |
| 33 | cmd := &cobra.Command{ |
| 34 | Use: "cleanup", |
| 35 | Short: "clean up cache directory", |
| 36 | RunE: func(cmd *cobra.Command, args []string) error { |
| 37 | err := config.NewCLIConfigImpl(cacheImpl.GlobalImpl) |
| 38 | if err != nil { |
| 39 | return err |
| 40 | } |
| 41 | |
| 42 | if err := cacheImpl.ValidateConfig(); err != nil { |
| 43 | return err |
| 44 | } |
| 45 | |
| 46 | a := app.New(cacheImpl) |
| 47 | return toCLIError(cacheImpl.GlobalImpl, a.CleanCacheDir(cacheImpl)) |
| 48 | }, |
| 49 | } |
| 50 | return cmd |
| 51 | } |
| 52 | |
| 53 | // NewCacheCmd returns cache subcmd |
| 54 | func NewCacheCmd(globalCfg *config.GlobalImpl) *cobra.Command { |
no test coverage detected