Documentation ¶
Index ¶
- Constants
- func FetchLatestRepo(provider string, branch string, progress io.Writer) (err error)
- func GetConfigDir() (configDir string, err error)
- func IsSupport(cfg HDConfig) bool
- type CmdWithArgs
- type HDConfig
- type HDPackage
- type Installer
- func (o *Installer) CheckDepAndInstall(tools map[string]string) (err error)
- func (o *Installer) GetVersion(path string) (version string, err error)
- func (o *Installer) Install() (err error)
- func (o *Installer) OverWriteBinary(sourceFile, targetPath string) (err error)
- func (o *Installer) ProviderURLParse(path string, acceptPreRelease bool) (packageURL string, err error)
Constants ¶
View Source
const ( // ConfigGitHub is the default git repository URI ConfigGitHub = "https://github.com/LinuxSuRen/hd-home" // ConfigBranch is the default branch name of hd-home git repository ConfigBranch = "master" )
View Source
const (
// ProviderGitHub represents https://github.com
ProviderGitHub = "github"
)
Variables ¶
This section is empty.
Functions ¶
func FetchLatestRepo ¶ added in v0.0.28
FetchLatestRepo fetches the hd-home as the config
func GetConfigDir ¶
GetConfigDir returns the directory of the config
Types ¶
type CmdWithArgs ¶
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"` AdditionBinaries []string `yaml:"additionBinaries"` FromSource bool `yaml:"fromSource"` URL string `yaml:"url"` Tar string `yaml:"tar"` SupportOS []string `yaml:"supportOS"` SupportArch []string `yaml:"supportArch"` Replacements map[string]string `yaml:"replacements"` Requirements []string `yaml:"requirements"` Installation *CmdWithArgs `yaml:"installation"` PreInstalls []CmdWithArgs `yaml:"preInstalls"` PostInstalls []CmdWithArgs `yaml:"postInstalls"` TestInstalls []CmdWithArgs `yaml:"testInstalls"` }
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 AdditionBinaries []string }
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 AdditionBinaries []string Org string Repo string }
Installer is a tool to install a package
func (*Installer) CheckDepAndInstall ¶
CheckDepAndInstall checks the desired tools, install the missing packages
func (*Installer) GetVersion ¶ added in v0.0.40
GetVersion parse install app info
func (*Installer) OverWriteBinary ¶ added in v0.0.34
OverWriteBinary install a binrary file
Click to show internal directories.
Click to hide internal directories.