mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-20 21:36:30 +02:00
feat: add support for more url aliases
This commit is contained in:
parent
8c97b3e73b
commit
cb9550f4a6
@ -29,6 +29,7 @@ var installCmd = &cobra.Command{
|
|||||||
Args: cobra.ArbitraryArgs,
|
Args: cobra.ArbitraryArgs,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
pack, err := core.LoadPack()
|
pack, err := core.LoadPack()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
@ -45,6 +46,14 @@ var installCmd = &cobra.Command{
|
|||||||
|
|
||||||
slug := strings.Replace(args[0], "https://github.com/", "", 1)
|
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)
|
mod, err := fetchMod(slug)
|
||||||
|
|
||||||
installMod(mod, pack)
|
installMod(mod, pack)
|
||||||
@ -198,11 +207,6 @@ func installVersion(mod Mod, version ModReleases, pack core.Pack) error {
|
|||||||
return err
|
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()
|
hash, error := file.getSha256()
|
||||||
if error != nil || hash == "" {
|
if error != nil || hash == "" {
|
||||||
return errors.New("file doesn't have a hash")
|
return errors.New("file doesn't have a hash")
|
||||||
|
@ -45,11 +45,6 @@ func (u ghUpdater) CheckUpdate(mods []core.Mod, mcVersion string, pack core.Pack
|
|||||||
continue
|
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
|
if newVersion.TagName == data.InstalledVersion { //The latest version from the site is the same as the installed one
|
||||||
results[i] = core.UpdateCheck{UpdateAvailable: false}
|
results[i] = core.UpdateCheck{UpdateAvailable: false}
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user