cache

package
v0.16.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

View Source
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

View Source
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

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL