Implemented a package manager to remove plugins

This commit is contained in:
2021-10-09 18:03:04 +04:00
parent fc5e834552
commit 9f304d26c1
4 changed files with 57 additions and 2 deletions

View File

@@ -279,6 +279,15 @@ var CliAction = func(ctx *cli.Context) error {
}
}
if RemovePlugin != "" {
err := plugin.DeletePlugin(RemovePlugin)
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Success")
}
}
return nil

View File

@@ -32,8 +32,9 @@ var (
// -- REMOVE ON REGULAR RELEASE --
Generate string
Modulename string
PullPlugin string
//--------------------------------
PullPlugin string
RemovePlugin string
)
var AppConfigFlags = []cli.Flag{
@@ -217,4 +218,11 @@ var AppConfigFlags = []cli.Flag{
EnvVars: []string{"PULLPLUGIN"},
Destination: &PullPlugin,
},
&cli.StringFlag{
Name: "RemovePlugin",
Aliases: []string{"rp"},
Usage: "Removes plugin",
EnvVars: []string{"REMOVEPLUGIN"},
Destination: &RemovePlugin,
},
}