clean

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APTCmd = &cobra.Command{
	Use: "apt",
	Run: func(cmd *cobra.Command, args []string) {
		c := exec.Command("sudo", "apt", "autoremove")
		_errors.Check(c.InteractiveRun())
	},
}
View Source
var BrewCmd = &cobra.Command{
	Use: "brew",
	Run: func(cmd *cobra.Command, args []string) {
		c := exec.Command("brew", "autoremove")
		_errors.Check(c.InteractiveRun())
		c = exec.Command("brew", "cleanup")
		_errors.Check(c.InteractiveRun())
	},
}
View Source
var CacheCmd = &cobra.Command{
	Use: "cache",
	Run: func(cmd *cobra.Command, args []string) {
		for _, p := range GlobPathes(patterns) {
			remove.Remove(p)
		}
	},
}
View Source
var NpmCmd = &cobra.Command{
	Use: "npm",
	Run: func(cmd *cobra.Command, args []string) {
		c := exec.Command("pnpm", "store", "prune")
		_errors.Check(c.InteractiveRun())
	},
}
View Source
var PipCmd = &cobra.Command{
	Use: "pip",
	Run: func(cmd *cobra.Command, args []string) {
		c := exec.Command("conda", "clean", "--all")
		_errors.Check(c.InteractiveRun())
		c = exec.Command("pip", "cache", "purge")
		_errors.Check(c.InteractiveRun())
	},
}
View Source
var RootCmd = &cobra.Command{
	Use: "clean",
	Run: exec.RunCommands,
}
View Source
var TLDRCmd = &cobra.Command{
	Use: "tldr",
	Run: func(cmd *cobra.Command, args []string) {
		c := exec.Command("tldr", "--clean-cache")
		_errors.Check(c.InteractiveRun())
	},
}
View Source
var TmpCmd = &cobra.Command{
	Use: "tmp",
	Run: func(cmd *cobra.Command, args []string) {
		pathes, err := filepath.Glob("/tmp/*")
		_errors.Check(err)
		for _, p := range pathes {
			remove.Remove(p)
		}
	},
}

Functions

func GlobPathes

func GlobPathes(patterns []string) (rtn []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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