installer

package
v0.0.55 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 25 Imported by: 4

Documentation

Index

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

func FetchLatestRepo(provider string, branch string,
	progress io.Writer) (err error)

FetchLatestRepo fetches the hd-home as the config

func FindCategories added in v0.0.54

func FindCategories() (result []string)

FindCategories returns the whole supported categories

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"`
	Categories       []string          `yaml:"categories"`
	Filename         string            `yaml:"filename"`
	FormatOverrides  PackagingFormat   `yaml:"formatOverrides"`
	Binary           string            `yaml:"binary"`
	TargetBinary     string            `yaml:"targetBinary"`
	AdditionBinaries []string          `yaml:"additionBinaries"`
	FromSource       bool              `yaml:"fromSource"`
	URL              string            `yaml:"url"`
	Tar              string            `yaml:"tar"`
	LatestVersion    string            `yaml:"latestVersion"`
	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"`

	Org, Repo string
}

HDConfig is the config of http-downloader

func FindPackagesByCategory added in v0.0.53

func FindPackagesByCategory(category string) (result []HDConfig)

FindPackagesByCategory returns the HDConfigs by category

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

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

CheckDepAndInstall checks the desired tools, install the missing packages

func (*Installer) GetVersion added in v0.0.40

func (o *Installer) GetVersion(path string) (version string, err error)

GetVersion parse install app info

func (*Installer) Install

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

Install installs a package

func (*Installer) OverWriteBinary added in v0.0.34

func (o *Installer) OverWriteBinary(sourceFile, targetPath string) (err error)

OverWriteBinary install a binrary file

func (*Installer) ProviderURLParse

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

ProviderURLParse parse the URL

type PackagingFormat added in v0.0.43

type PackagingFormat struct {
	Windows string `yaml:"windows"`
	Linux   string `yaml:"linux"`
}

PackagingFormat is used for containing config depending on machine

Jump to

Keyboard shortcuts

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