cmd

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: Apache-2.0 Imports: 17 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadDependency

func DownloadDependency(dependencyName string) error

Using go mod download {dependency} command to download the dependency

func Error

func Error(pattern *gofrogio.CmdOutputPattern) (string, error)

func GetCachePath added in v0.4.0

func GetCachePath() (string, error)

GetCachePath returns the location of downloads dir insied the GOMODCACHE

func GetDependenciesGraph

func GetDependenciesGraph(projectDir string) (map[string][]string, error)

Runs 'go mod graph' command and returns map that maps dependencies to their child dependencies slice

func GetDependenciesList added in v0.2.0

func GetDependenciesList(projectDir string) (map[string]bool, error)

Runs go list -f {{with .Module}}{{.Path}}:{{.Version}}{{end}} all command and returns map of the dependencies

func GetFileDetails

func GetFileDetails(filePath string) (modFileContent []byte, modFileStat os.FileInfo, err error)

func GetGoModCachePath added in v0.4.0

func GetGoModCachePath() (string, error)

GetGoModCachePath returns the location of the go module cache

func GetGoSum

func GetGoSum(rootProjectDir string) (sumFileContent []byte, sumFileStat os.FileInfo, err error)

func GetGoVersion

func GetGoVersion() (string, error)

func GetModuleNameByDir added in v0.5.0

func GetModuleNameByDir(projectDir string) (string, error)

Runs 'go list -m' command and returns module name

func GetProjectRoot

func GetProjectRoot() (string, error)

Returns the root dir where the go.mod located.

func RemoveCredentials added in v0.1.18

func RemoveCredentials(pattern *gofrogio.CmdOutputPattern) (string, error)

Remove the credentials information from the line.

func RestoreSumFile

func RestoreSumFile(rootProjectDir string, sumFileContent []byte, sumFileStat os.FileInfo) error

func RunGo

func RunGo(goArg []string, server auth.ServiceDetails, repo string, noFallback bool) error

Types

type Cmd

type Cmd struct {
	Go           string
	Command      []string
	CommandFlags []string
	Dir          string
	StrWriter    io.WriteCloser
	ErrWriter    io.WriteCloser
}

func NewCmd

func NewCmd() (*Cmd, error)

func (*Cmd) GetCmd

func (config *Cmd) GetCmd() (cmd *exec.Cmd)

func (*Cmd) GetEnv

func (config *Cmd) GetEnv() map[string]string

func (*Cmd) GetErrWriter

func (config *Cmd) GetErrWriter() io.WriteCloser

func (*Cmd) GetStdWriter

func (config *Cmd) GetStdWriter() io.WriteCloser

Jump to

Keyboard shortcuts

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