tool

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(tools []Tool) error

Install creates the directories necessary to install the provided tools and

func InstallDir

func InstallDir() (string, error)

func LatestDir

func LatestDir() (string, error)

func Remove

func Remove(tools []Tool) error

Remove removes the provided tools from the install directory

func RemoveInstallDir

func RemoveInstallDir() error

Types

type Map

type Map map[string]Tool

func GetMap

func GetMap() Map

func (Map) Names

func (m Map) Names() []string

type Tool

type Tool interface {
	// Name returns the name of the tool
	Name() string

	// Install fetches the latest tool from it's respective source, installs
	// it in a tool-unique directory under the provided rootDir, and symlinks
	// it to provided the latestDir
	Install(rootDir, latestDir string) error

	// Confiure is currently unused
	Configure() error

	// Remove uninstalls the tool by deleting it's tool-unique directory under
	// the provided rootDir and unlinking itself from the latestDir
	Remove(rootDir, latestDir string) error

	// Installed validates whether the tool has already been installed under the
	// provided rootDir or not
	Installed(rootDir string) (bool, error)
}

func ListInstalled added in v0.1.0

func ListInstalled() ([]Tool, error)

ListInstalled returns a slice containing all tools the current machine has installed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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