Skip to content

Commit

Permalink
fix: prevent proceeding to add item w/o mod id
Browse files Browse the repository at this point in the history
  • Loading branch information
kldzj committed May 13, 2023
1 parent daa5d51 commit 6544d13
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion interactive/mods-add.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,15 @@ func addMod(id string, config *ini.ServerConfig) (bool, error) {
}

if mod == "" {
if len(parsed.Mods) == 0 {
return false, fmt.Errorf("need at least one Mod ID to continue")
}

break
}

parsed.Mods = append(parsed.Mods, mod)
fmt.Println(util.Info, "Manually added mod:", mod)
fmt.Println(util.Info, "Manually added Mod ID:", mod)

if !Confirm("Add another Mod ID?", true) {
break
Expand Down

0 comments on commit 6544d13

Please sign in to comment.