MCPcopy
hub / github.com/helmfile/helmfile / NewCacheCleanupSubcommand

Function NewCacheCleanupSubcommand

cmd/cache.go:32–51  ·  view source on GitHub ↗
(cacheImpl *config.CacheImpl)

Source from the content-addressed store, hash-verified

30}
31
32func 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
54func NewCacheCmd(globalCfg *config.GlobalImpl) *cobra.Command {

Callers 1

NewCacheCmdFunction · 0.85

Calls 5

NewCLIConfigImplFunction · 0.92
NewFunction · 0.92
toCLIErrorFunction · 0.85
CleanCacheDirMethod · 0.80
ValidateConfigMethod · 0.45

Tested by

no test coverage detected