INNER CODE UNIT · Go
cacheInfoCommand
kitops-ml/kitops · pkg/cmd/kitcache/cmd.go:57
func cacheInfoCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "info",
Short: `Get information about cache disk usage`,
Long: `Print the total size of temporary files in the cache directory.`,
RunE: func(cmd *cobra.Command, args []string) error {
totalSize, stats, err := fscache.StatCache()
if err != nil {
return output.Fatalln(err)
}
if totalSize == 0 {
output.Infof("Cache is currently empty")
return nil
}
printCacheInfo(cmd.OutOrStdout(), totalSize, stats)
return nil
},
}