workdir

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatsVer1 = "v1"
)

Variables

View Source
var (
	ErrToolNotFoundInSpec = errors.New("tool not found in spec")
	ErrToolNotInstalled   = errors.New("tool not installed")
)

Functions

func Init added in v0.14.1

func Init(fs fsh.FS, dir string) error

Init will initialize context in specified directory.

Types

type Workdir added in v0.14.1

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

func New added in v0.14.1

func New(ctx context.Context, fs fsh.FS, dir string) (*Workdir, error)

func (*Workdir) Add added in v0.14.1

func (c *Workdir) Add(ctx context.Context, runtime, program string, alias optional.Val[string], tags []string) (bool, string, error)

func (*Workdir) AddInclude added in v0.14.1

func (c *Workdir) AddInclude(ctx context.Context, source string, tags []string) (int, error)

func (*Workdir) CopySource added in v0.14.1

func (c *Workdir) CopySource(ctx context.Context, source string, tags []string) (int, error)

CopySource will add all tools from source. Source can be a path to file or a http url or git repo.

func (*Workdir) FindTool added in v0.14.1

func (c *Workdir) FindTool(name string) (*structs.ToolState, error)

func (*Workdir) GetTools added in v0.15.0

func (c *Workdir) GetTools(ctx context.Context) ([]structs.ToolState, error)

func (*Workdir) RemoveTool added in v0.22.0

func (c *Workdir) RemoveTool(ctx context.Context, target string) error

func (*Workdir) RunTool added in v0.14.1

func (c *Workdir) RunTool(ctx context.Context, str string, args ...string) error

RunTool will run a tool by its name and args.

func (*Workdir) RuntimeAdd added in v0.24.0

func (c *Workdir) RuntimeAdd(ctx context.Context, runtime string) error

func (*Workdir) RuntimeList added in v0.24.0

func (c *Workdir) RuntimeList() []string

func (*Workdir) Save added in v0.14.1

func (c *Workdir) Save() error

func (*Workdir) Sync added in v0.14.1

func (c *Workdir) Sync(ctx context.Context, maxWorkers int, tags []string) error

Sync will read the locked tools and try to install the desired version. It will skip the installation in case when we have a desired version.

func (*Workdir) Upgrade added in v0.14.1

func (c *Workdir) Upgrade(ctx context.Context, tags []string) error

Upgrade will upgrade only spec tools. and re-fetch latest versions of includes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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