util

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Homebrew = "homebrew"
)

Variables

View Source
var (
	AppName    = "ankor"
	TemplateFS embed.FS

	Force bool
)
View Source
var (
	ErrMissingExecutable = errors.New("must be installed on your system and available in your $PATH")
)

Functions

func AddToPath

func AddToPath(path string) (string, error)

AddToPath attempts to add supplied path to the systems shell environment as well as adding it to the os.Environ for teh current run.

func AddToPathCmd

func AddToPathCmd(sub string, cmd ...string) (string, error)

AddToPathCmd will use the supplied cmd to retrieve the value for a path and add the sub suffix to the pat for adding to PATH.

func CreateConfigFromSourceTemplate

func CreateConfigFromSourceTemplate(source, target string, data map[string]interface{}) error

func CreateConfigFromTemplate

func CreateConfigFromTemplate(name string, data map[string]interface{}) error

func CreateFromSourceTemplate

func CreateFromSourceTemplate(source, target string, t embed.FS, data map[string]interface{}) error

func GetPath

func GetPath(name string, installers ...DependencyInstaller) string

GetPath attempts to retrieve path for specified executable name.

func IsBrewInstallation

func IsBrewInstallation() bool

func PathByName

func PathByName(name string) string

Types

type DependencyInstaller

type DependencyInstaller func() (string, error)

type Dirs

type Dirs struct {
	HomeDir   string
	AnkorDir  string
	ConfigDir string
	OptDir    string
	BinDir    string
	TmpDir    string
}

func NewDirs

func NewDirs() Dirs

func (*Dirs) GetAnkorDir

func (d *Dirs) GetAnkorDir() string

func (*Dirs) GetBinDir

func (d *Dirs) GetBinDir() string

func (*Dirs) GetCompletionDir

func (d *Dirs) GetCompletionDir() string

func (*Dirs) GetConfigDir

func (d *Dirs) GetConfigDir() string

func (*Dirs) GetHomeDir

func (d *Dirs) GetHomeDir() string

func (*Dirs) GetLogsDir

func (d *Dirs) GetLogsDir() string

func (*Dirs) GetOptDir

func (d *Dirs) GetOptDir() string

func (*Dirs) GetPluginsDir

func (d *Dirs) GetPluginsDir() string

func (*Dirs) GetTmpDir

func (d *Dirs) GetTmpDir() string

type PluginInfo

type PluginInfo struct {
	Name         *PluginName
	Dependencies []*PluginName
	Fields       map[string]string
}

type PluginName

type PluginName struct {
	Name string
	Type string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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