diff --git a/github/install.go b/github/install.go index b5c662f..1ac9113 100644 --- a/github/install.go +++ b/github/install.go @@ -29,6 +29,7 @@ var installCmd = &cobra.Command{ Args: cobra.ArbitraryArgs, Run: func(cmd *cobra.Command, args []string) { pack, err := core.LoadPack() + if err != nil { fmt.Println(err) os.Exit(1) @@ -45,6 +46,14 @@ var installCmd = &cobra.Command{ slug := strings.Replace(args[0], "https://github.com/", "", 1) + if len(strings.Split(args[0], "/")) == 1 { + slug = args[0] + } + + if strings.Contains(slug, "/releases") { + slug = strings.Split(slug, "/releases")[0] + } + mod, err := fetchMod(slug) installMod(mod, pack) @@ -198,11 +207,6 @@ func installVersion(mod Mod, version ModReleases, pack core.Pack) error { return err } - // side := mod.getSide() - // if side == "" { - // return errors.New("version doesn't have a side that's supported. Server: " + mod.ServerSide + " Client: " + mod.ClientSide) - // } - hash, error := file.getSha256() if error != nil || hash == "" { return errors.New("file doesn't have a hash") diff --git a/github/updater.go b/github/updater.go index 647a2ba..138b963 100644 --- a/github/updater.go +++ b/github/updater.go @@ -45,11 +45,6 @@ func (u ghUpdater) CheckUpdate(mods []core.Mod, mcVersion string, pack core.Pack continue } - // if newVersion.ID == "" { //There is no version available for this minecraft version or loader. - // results[i] = core.UpdateCheck{UpdateAvailable: false} - // continue - // } - if newVersion.TagName == data.InstalledVersion { //The latest version from the site is the same as the installed one results[i] = core.UpdateCheck{UpdateAvailable: false} continue