Fix error reporting when installing Modrinth mods from URL

This commit is contained in:
comp500 2021-12-02 19:53:54 +00:00
parent 96a2d5fdf6
commit 5ef3358285

View File

@ -81,12 +81,15 @@ var installCmd = &cobra.Command{
} else { } else {
//This wasn't a valid modid/slug, try to search for it instead: //This wasn't a valid modid/slug, try to search for it instead:
//Don't bother to search if it looks like a url though //Don't bother to search if it looks like a url though
if !strings.Contains(args[0], "modrinth.com") { if matches == nil {
err = installViaSearch(args[0], pack) err = installViaSearch(args[0], pack)
if err != nil { if err != nil {
fmt.Printf("Failed installing mod: %s\n", err) fmt.Printf("Failed installing mod: %s\n", err)
os.Exit(1) os.Exit(1)
} }
} else {
fmt.Printf("Failed installing mod: %s\n", err)
os.Exit(1)
} }
} }
}, },