installer

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: MIT Imports: 22 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// ProviderGitHub represents https://github.com
	ProviderGitHub = "github"
)

Variables

This section is empty.

Functions

func FetchConfig

func FetchConfig() (err error)

FetchConfig fetches the hd-home as the config

func GetConfigDir

func GetConfigDir() (configDir string, err error)

GetConfigDir returns the directory of the config

func IsSupport

func IsSupport(cfg HDConfig) bool

IsSupport checks if support

Types

type CmdWithArgs

type CmdWithArgs struct {
	Cmd  string   `yaml:"cmd"`
	Args []string `yaml:"args"`
}

CmdWithArgs is a command with arguments

type HDConfig

type HDConfig struct {
	Name         string            `yaml:"Name"`
	Filename     string            `yaml:"filename"`
	Binary       string            `yaml:"binary"`
	TargetBinary string            `yaml:"targetBinary"`
	URL          string            `yaml:"url"`
	Tar          string            `yaml:"tar"`
	SupportOS    []string          `yaml:"supportOS"`
	SupportArch  []string          `yaml:"supportArch"`
	Replacements map[string]string `yaml:"replacements"`
	Installation *CmdWithArgs      `yaml:"installation"`
	PreInstall   *CmdWithArgs      `yaml:"preInstall"`
	PostInstall  *CmdWithArgs      `yaml:"postInstall"`
	TestInstall  *CmdWithArgs      `yaml:"testInstall"`
}

HDConfig is the config of http-downloader

type HDPackage

type HDPackage struct {
	Name       string
	Version    string // e.g. v1.0.1
	VersionNum string // e.g. 1.0.1
	OS         string // e.g. linux, darwin
	Arch       string // e.g. amd64
}

HDPackage represents a package of http-downloader

type Installer

type Installer struct {
	Package      *HDConfig
	Tar          bool
	Output       string
	Source       string
	Name         string
	CleanPackage bool
	Provider     string
	OS           string
	Arch         string
	Fetch        bool
}

Installer is a tool to install a package

func (*Installer) CheckDepAndInstall

func (o *Installer) CheckDepAndInstall(tools map[string]string) (err error)

CheckDepAndInstall checks the desired tools, install the missing packages

func (*Installer) Install

func (o *Installer) Install() (err error)

Install installs a package

func (*Installer) ProviderURLParse

func (o *Installer) ProviderURLParse(path string, acceptPreRelease bool) (url string, err error)

ProviderURLParse parse the URL

Jump to

Keyboard shortcuts

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