Add another return type to tools.RemoveMod
This commit is contained in:
parent
222fa543b5
commit
fa4aeeb406
@ -51,7 +51,10 @@ func RemoveMod(pkg string) {
|
||||
|
||||
buffer := cyan(fmt.Sprint(" > ", tools.ExposeModString(pkg), "... "))
|
||||
|
||||
if tools.RemoveMod(tools.ExposeModString(pkg)) == 1 {
|
||||
status := tools.RemoveMod(tools.ExposeModString(pkg))
|
||||
if status == 2 {
|
||||
buffer += red("mod not found")
|
||||
} else if status == 1 {
|
||||
buffer += red("not installed")
|
||||
} else {
|
||||
buffer += blue("uninstalled")
|
||||
|
@ -81,12 +81,13 @@ func DownloadMod(depString string) (int, string, []string) {
|
||||
}
|
||||
|
||||
// RemoveMod uninstalls a mod
|
||||
// RemoveMod returns 2 if the mod string was not found, 1 if the mod isn't installed and 0 on success
|
||||
func RemoveMod(depString string) int {
|
||||
// fmt.Println(depString)
|
||||
status, mod := api.GetModData(depString)
|
||||
// fmt.Println(mod)
|
||||
if status != 0 {
|
||||
return 1
|
||||
return 2
|
||||
}
|
||||
modFolder := utils.SystemInfo.PluginDir + "/" + depString + "-" + mod.Versions[0].VersionNumber
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user