modmanager

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteMod

func DeleteMod(profileName, modDirName string) error

DeleteMod deletes a mod.

func DisableMod

func DisableMod(modName, profileName string) error

DisableMod disables a mod.

func DownloadAndCacheBepInEx

func DownloadAndCacheBepInEx(basePath string, version string) (string, error)

DownloadAndCacheBepInEx downloads and caches the latest BepInEx release. Returns the path to the downloaded zip file.

func EnableMod

func EnableMod(modName, profileName string) error

EnableMod enables a mod.

func FetchLatestBepInExVersion

func FetchLatestBepInExVersion() (string, error)

FetchLatestBepInExVersion fetches the latest stable release version of BepInEx from GitHub.

func InstallMod

func InstallMod(profileName, modAuthor, modTitle string) error

InstallMod installs or updates the specified mod in the given profile.

func InstallModFromUrl added in v0.0.7

func InstallModFromUrl(profile, modUrl string) error

func IsBepInExCached

func IsBepInExCached(basePath string) bool

func IsBepInExUpToDate

func IsBepInExUpToDate(basePath string, currentConfig *config.Config) (bool, error)

IsBepInExUpToDate checks if the cached version of BepInEx matches the latest stable version.

func MovePlugins

func MovePlugins(modPath string) error

MovePlugins searches for a 'plugins' directory inside the modPath or inside 'modPath/BepInEx'. If found, it moves all contents from the 'plugins' directory to the modPath.

func UnpackBepInEx

func UnpackBepInEx(targetDir string) error

UnpackBepInEx unpacks the BepInEx zip into the specified directory.

func Unzip

func Unzip(src, dest string) error

func UnzipMod

func UnzipMod(src, dest string) error

UnzipMod unzips the mod file into the specified profile folder and removes the zip file. Returns mod name and error

Types

type BepInExRelease

type BepInExRelease struct {
	TagName string `json:"tag_name"`
	Assets  []struct {
		BrowserDownloadURL string `json:"browser_download_url"`
	} `json:"assets"`
}

BepInExRelease represents the structure of a GitHub release.

type ModDetails

type ModDetails struct {
	Author     string      `json:"author"`
	ModDirName string      `json:"mod_dir_name"`
	Manifest   ModManifest `json:"manifest"`
}

func ListMods

func ListMods(profileName string) ([]ModDetails, error)

ListMods returns a list of all mods.

type ModManifest

type ModManifest struct {
	Name         string   `json:"name"`
	Version      string   `json:"version_number"`
	Description  string   `json:"description"`
	Dependencies []string `json:"dependencies"`
}

func ReadModManifest

func ReadModManifest(manifestPath string) (ModManifest, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL