exec

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dirs

type Dirs struct {
	Root     string
	DataRoot string
}

type Env

type Env struct {
	Paths            *PathsConfig
	ConfigRootEnvKey string
}

func NewEnv

func NewEnv(paths *PathsConfig, configRootEnvKey string) *Env

func (*Env) Command

func (e *Env) Command(name string, args ...string) *osexec.Cmd

func (*Env) CommandContext

func (e *Env) CommandContext(ctx context.Context, name string, args ...string) *osexec.Cmd

func (*Env) Environ

func (e *Env) Environ() []string

func (*Env) LookPath

func (e *Env) LookPath(file string) (string, error)

func (*Env) PrependBinToPATH

func (e *Env) PrependBinToPATH() error

func (*Env) PrependBinToPATHForDataRoot

func (e *Env) PrependBinToPATHForDataRoot(dataRoot string) error

func (*Env) WithBinPath

func (e *Env) WithBinPath(env []string) []string

func (*Env) WithConfigRoot

func (e *Env) WithConfigRoot(env []string) []string

type PathsConfig

type PathsConfig struct {
	RootDirName string
	DataDirName string
	BinDirName  string
}

func (*PathsConfig) BinDir

func (c *PathsConfig) BinDir(root string) string

func (*PathsConfig) BinDirForDataRoot

func (c *PathsConfig) BinDirForDataRoot(dataRoot string) (string, error)

func (*PathsConfig) DataRoot

func (c *PathsConfig) DataRoot(root string) string

func (*PathsConfig) DefaultDataRoot

func (c *PathsConfig) DefaultDataRoot() (string, error)

func (*PathsConfig) DefaultRoot

func (c *PathsConfig) DefaultRoot() (string, error)

func (*PathsConfig) HomeBinDir

func (c *PathsConfig) HomeBinDir() (string, error)

func (*PathsConfig) HomeDataRoot

func (c *PathsConfig) HomeDataRoot() (string, error)

func (*PathsConfig) HomeRoot

func (c *PathsConfig) HomeRoot() (string, error)

func (*PathsConfig) Resolve

func (c *PathsConfig) Resolve(rootFlag string) (Dirs, error)

func (*PathsConfig) ResolveDataRoot

func (c *PathsConfig) ResolveDataRoot(rootFlag string) (string, error)

func (*PathsConfig) RootFromDataRoot

func (c *PathsConfig) RootFromDataRoot(dataRoot string) (string, error)

Directories

Path Synopsis
Package toolresolve provides centralized binary resolution that respects both the system PATH, the well-known extra install paths (e.g.
Package toolresolve provides centralized binary resolution that respects both the system PATH, the well-known extra install paths (e.g.

Jump to

Keyboard shortcuts

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