buffalo: github.com/gobuffalo/buffalo/buffalo/cmd/plugins/internal/cache Index | Files

package cache

import "github.com/gobuffalo/buffalo/buffalo/cmd/plugins/internal/cache"

Index

Package Files

build.go clean.go list.go

Variables

var BuildCmd = &cobra.Command{
    Use:   "build",
    Short: "rebuilds the plugins cache",
    RunE: func(cmd *cobra.Command, args []string) error {
        os.RemoveAll(plugins.CachePath)
        _, err := plugins.Available()
        return err
    },
}

BuildCmd rebuilds the plugins cache

var CleanCmd = &cobra.Command{
    Use:   "clean",
    Short: "cleans the plugins cache",
    RunE: func(cmd *cobra.Command, args []string) error {
        os.RemoveAll(plugins.CachePath)
        return nil
    },
}

CleanCmd cleans the plugins cache

var ListCmd = &cobra.Command{
    Use:   "list",
    Short: "displays the contents of the plugin cache",
    RunE: func(cmd *cobra.Command, args []string) error {
        b, err := ioutil.ReadFile(plugins.CachePath)
        if err != nil {
            return err
        }
        m := map[string]interface{}{}
        err = json.Unmarshal(b, &m)
        if err != nil {
            return err
        }
        is, err := json.MarshalIndent(m, "", "  ")
        if err != nil {
            return err
        }

        fmt.Println(string(is))
        return nil
    },
}

ListCmd displays the contents of the plugin cache

Package cache imports 6 packages (graph) and is imported by 3 packages. Updated 2019-08-21. Refresh now. Tools for package owners.