helpers

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadEnvfile added in v0.10.0

func LoadEnvfile(env *env.Env, path string) error

LoadEnvfile sets all the environment variables defined in an envfile

func NewDownloader added in v0.11.0

func NewDownloader(url string) *downloader

func VirtualenvName

func VirtualenvName(proj *project.Project, version string) string

Types

type GitRepo added in v0.4.0

type GitRepo struct {
	// contains filtered or unexported fields
}

GitRepo represents a local git repository

func NewGitRepo added in v0.4.0

func NewGitRepo(path string) *GitRepo

NewGitRepo returns a GitRepo

func (*GitRepo) BuildGithubProjectURL added in v0.4.0

func (r *GitRepo) BuildGithubProjectURL() (string, error)

BuildGithubProjectURL builds the Github page url from the git remote url for a specific branch

func (*GitRepo) BuildGithubPullrequestURL added in v0.4.0

func (r *GitRepo) BuildGithubPullrequestURL() (string, error)

BuildGithubPullrequestURL builds the Github pullrequest url from the git remote url for a specific branch

func (*GitRepo) GetCurrentBranch added in v0.4.0

func (r *GitRepo) GetCurrentBranch() (string, error)

GetCurrentBranch returns the name of the branch or "HEAD" for special cases

func (*GitRepo) GetRemoteURL added in v0.4.0

func (r *GitRepo) GetRemoteURL() (string, error)

GetRemoteURL returns the URL of the origin remote

type Github added in v0.2.0

type Github struct {
	// contains filtered or unexported fields
}

func NewGithub added in v0.2.0

func NewGithub() *Github

func NewGithubWithClient added in v0.2.0

func NewGithubWithClient(client *http.Client) *Github

func (*Github) Get added in v0.2.0

func (g *Github) Get(url string) (data []byte, err error)

Get download the content at `url`

func (*Github) LatestRelease added in v0.2.0

func (g *Github) LatestRelease(platform string) (*GithubReleaseItem, error)

LatestRelease get latest release url for a specific `platform`

type GithubReleaseItem added in v0.2.0

type GithubReleaseItem struct {
	Platform    string `json:"name"`
	DownloadURL string `json:"browser_download_url"`
}

type GithubReleaseList added in v0.2.0

type GithubReleaseList struct {
	TagName string              `json:"tag_name"`
	Items   []GithubReleaseItem `json:"assets"`
}

type Golang added in v0.1.0

type Golang struct {
	// contains filtered or unexported fields
}

func NewGolang added in v0.1.0

func NewGolang(cfg *config.Config, version string) *Golang

func (*Golang) BinPath added in v0.1.0

func (g *Golang) BinPath() string

func (*Golang) Exists added in v0.1.0

func (g *Golang) Exists() bool

func (*Golang) Install added in v0.1.0

func (g *Golang) Install() (err error)

func (*Golang) Path added in v0.1.0

func (g *Golang) Path() string

func (*Golang) Which added in v0.2.0

func (g *Golang) Which(program string) string

type Homebrew added in v0.5.0

type Homebrew struct {
	// contains filtered or unexported fields
}

Homebrew represent an homebrew installation

func NewHomebrew added in v0.5.0

func NewHomebrew() *Homebrew

NewHomebrew is returning a new Cellar

func NewHomebrewWithPrefix added in v0.5.0

func NewHomebrewWithPrefix(prefixes ...string) *Homebrew

NewHomebrewWithPrefix is returning a new Cellar at prefix

func (*Homebrew) IsInstalled added in v0.5.0

func (h *Homebrew) IsInstalled(formula string) (installed bool)

IsInstalled returns true if `pkg` is installed in cellar or in caskroom

type Node added in v0.8.0

type Node struct {
	// contains filtered or unexported fields
}

func NewNode added in v0.8.0

func NewNode(cfg *config.Config, version string) *Node

func (*Node) BinPath added in v0.8.0

func (n *Node) BinPath() string

func (*Node) Exists added in v0.8.0

func (n *Node) Exists() bool

func (*Node) Install added in v0.8.0

func (n *Node) Install() error

func (*Node) Path added in v0.8.0

func (n *Node) Path() string

func (*Node) Which added in v0.8.0

func (n *Node) Which(program string) string

type PyEnv

type PyEnv struct {
	// contains filtered or unexported fields
}

func NewPyEnv

func NewPyEnv() (*PyEnv, error)

func (*PyEnv) VersionInstalled

func (p *PyEnv) VersionInstalled(version string) (installed bool, err error)

func (*PyEnv) Which

func (p *PyEnv) Which(version string, command string) string

type Upgrader added in v0.2.0

type Upgrader struct {
	// contains filtered or unexported fields
}

func NewUpgrader added in v0.2.0

func NewUpgrader(useSudo bool) (u *Upgrader)

NewUpgrader returns a new upgrade helper using the default http client

func NewUpgraderWithHTTPClient added in v0.2.0

func NewUpgraderWithHTTPClient(client *http.Client, useSudo bool) (u *Upgrader)

NewUpgraderWithHTTPClient returns a new upgrade helper using the provided http client

func (*Upgrader) LatestRelease added in v0.2.0

func (u *Upgrader) LatestRelease(plateform string) (release *GithubReleaseItem, err error)

LatestRelease get latest release item for current platform

func (*Upgrader) Perform added in v0.2.0

func (u *Upgrader) Perform(ui *termui.UI, destinationPath string, sourceURL string) (err error)

Perform is fetching a new executable from `release` and upgrading the executable at `destinationPath` with it

type Virtualenv

type Virtualenv struct {
	// contains filtered or unexported fields
}

func NewVirtualenv

func NewVirtualenv(cfg *config.Config, name string) *Virtualenv

func (*Virtualenv) BinPath

func (v *Virtualenv) BinPath() string

func (*Virtualenv) Exists

func (v *Virtualenv) Exists() bool

func (*Virtualenv) Path

func (v *Virtualenv) Path() string

func (*Virtualenv) Which added in v0.0.7

func (v *Virtualenv) Which(cmd string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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