diff --git a/cmd/purge.go b/cmd/purge.go new file mode 100644 index 0000000..0c3d48b --- /dev/null +++ b/cmd/purge.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "fmt" + "os" + + "github.com/getantibody/antibody/antibodylib" + "github.com/getantibody/antibody/project" + "github.com/spf13/cobra" +) + +var purgeCmd = &cobra.Command{ + Use: "purge", + Aliases: []string{"rm"}, + Short: "removes a dependency from your filesystem", + RunE: func(cmd *cobra.Command, args []string) error { + fmt.Println("Removing", args[0]) + return os.RemoveAll(project.New(antibodylib.Home(), args[0]).Folder()) + }, +} + +func init() { + RootCmd.AddCommand(purgeCmd) +}