Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayIncludes[T comparable](arr []T, v T) bool
- func CheckForOwnership(path string) bool
- func CheckIfErrIsCauseItsBusyRn(err error) error
- func CheckScuffedInstall() bool
- func ExistsFile(path string) bool
- func FindAsarFile(dir string) (*os.File, error)
- func FindDiscords() []any
- func FixOwnership(p string) error
- func GetBranch(name string) string
- func HandleScuffedInstall()
- func InitGithubDownloader()
- func InstallLatestBuilds() error
- func IsDirectory(path string) bool
- func IsSafeToDelete(path string) error
- func PreparePatch(di *DiscordInstall)
- func Ptr[T any](v T) *T
- func Ternary[T any](b bool, ifTrue, ifFalse T) T
- func Unwrap[T any](v T, err error) T
- type DiscordData
- type DiscordInstall
- type GithubRelease
- type Installer
- func (i *Installer) CheckForOwnershipDarwin(path string) bool
- func (i *Installer) ChooseCustomInstall() (string, error)
- func (i *Installer) GetBaseDir() string
- func (i *Installer) GetInstalledVersion() string
- func (i *Installer) GetLatestVersion() string
- func (i *Installer) InstallOpenAsar(path string) error
- func (i *Installer) ListInstalls() []DiscordData
- func (i *Installer) Patch(path string) error
- func (i *Installer) PromptForChown(path string) bool
- func (i *Installer) Repair(path string) error
- func (i *Installer) Startup(ctx context.Context)
- func (i *Installer) UninstallOpenAsar(path string) error
- func (i *Installer) Unpatch(path string) error
Constants ¶
View Source
const InstallerReleaseUrl = "https://api.github.com/repos/Vencord/Installer/releases/latest"
View Source
const InstallerReleaseUrlFallback = "https://vencord.dev/releases/installer"
View Source
const OpenAsarDownloadLink = "https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar"
View Source
const ReleaseUrl = "https://api.github.com/repos/Vendicated/Vencord/releases/latest"
View Source
const ReleaseUrlFallback = "https://vencord.dev/releases/vencord"
Variables ¶
View Source
var ( Home string DiscordDirs []string )
View Source
var BaseDir string
View Source
var FilesDir string
View Source
var FilesDirErr error
View Source
var GithubDoneChan chan bool
View Source
var GithubError error
View Source
var InstalledHash = "None"
View Source
var InstallerGitHash = "Unknown"
View Source
var InstallerTag = "Unknown"
View Source
var IsDevInstall bool
View Source
var LatestHash = "Unknown"
View Source
var LinuxDiscordNames = []string{
"Discord",
"DiscordPTB",
"DiscordCanary",
"DiscordDevelopment",
"discord",
"discordptb",
"discordcanary",
"discorddevelopment",
"discord-ptb",
"discord-canary",
"discord-development",
"com.discordapp.Discord",
"com.discordapp.DiscordPTB",
"com.discordapp.DiscordCanary",
"com.discordapp.DiscordDevelopment",
}
View Source
var PackageJson = []byte(`{
"name": "discord",
"main": "index.js"
}
`)
View Source
var Patcher string
View Source
var UserAgent = "VencordInstaller/" + InstallerGitHash + " (https://github.com/Vencord/Installer)"
Functions ¶
func ArrayIncludes ¶
func ArrayIncludes[T comparable](arr []T, v T) bool
func CheckForOwnership ¶
func CheckScuffedInstall ¶
func CheckScuffedInstall() bool
func ExistsFile ¶
func FindDiscords ¶
func FindDiscords() []any
func HandleScuffedInstall ¶
func HandleScuffedInstall()
func InitGithubDownloader ¶
func InitGithubDownloader()
func InstallLatestBuilds ¶
func InstallLatestBuilds() error
func IsDirectory ¶
func IsSafeToDelete ¶
IsSafeToDelete returns nil if path is safe to delete. In other cases, the returned error should give more info
func PreparePatch ¶
func PreparePatch(di *DiscordInstall)
Types ¶
type DiscordData ¶
type DiscordInstall ¶
type DiscordInstall struct {
// contains filtered or unexported fields
}
func ParseDiscord ¶
func ParseDiscord(p, _ string) *DiscordInstall
func (*DiscordInstall) InstallOpenAsar ¶
func (di *DiscordInstall) InstallOpenAsar() error
func (*DiscordInstall) IsOpenAsar ¶
func (di *DiscordInstall) IsOpenAsar() (retBool bool)
func (*DiscordInstall) UninstallOpenAsar ¶
func (di *DiscordInstall) UninstallOpenAsar() error
type GithubRelease ¶
type GithubRelease struct { Name string `json:"name"` TagName string `json:"tag_name"` Assets []struct { Name string `json:"name"` DownloadURL string `json:"browser_download_url"` } `json:"assets"` }
var ReleaseData GithubRelease
func GetGithubRelease ¶
func GetGithubRelease(url, fallbackUrl string) (*GithubRelease, error)
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
func NewInstaller ¶
func NewInstaller() *Installer
func (*Installer) CheckForOwnershipDarwin ¶
func (*Installer) ChooseCustomInstall ¶
func (*Installer) GetBaseDir ¶
func (*Installer) GetInstalledVersion ¶
func (*Installer) GetLatestVersion ¶
func (*Installer) InstallOpenAsar ¶
func (*Installer) ListInstalls ¶
func (i *Installer) ListInstalls() []DiscordData
func (*Installer) PromptForChown ¶
func (*Installer) UninstallOpenAsar ¶
Click to show internal directories.
Click to hide internal directories.