Documentation ¶
Overview ¶
Package shims manages writing and parsing of asdf shim scripts.
Index ¶
- func Directory(conf config.Config) string
- func ExecutableDirs(plugin plugins.Plugin) ([]string, error)
- func ExecutableOnPath(path, command string) (string, error)
- func ExecutablePaths(conf config.Config, plugin plugins.Plugin, version toolversions.Version) ([]string, error)
- func FindExecutable(conf config.Config, shimName, currentDirectory string) (string, plugins.Plugin, string, bool, error)
- func GenerateAll(conf config.Config, stdOut io.Writer, stdErr io.Writer) error
- func GenerateForPluginVersions(conf config.Config, plugin plugins.Plugin, stdOut io.Writer, stdErr io.Writer) error
- func GenerateForVersion(conf config.Config, plugin plugins.Plugin, version toolversions.Version, ...) error
- func GetExecutablePath(conf config.Config, plugin plugins.Plugin, shimName string, ...) (string, error)
- func GetToolsAndVersionsFromShimFile(shimPath string) (versions []toolversions.ToolVersions, err error)
- func Path(conf config.Config, shimName string) string
- func RemoveAll(conf config.Config) error
- func SystemExecutableOnPath(conf config.Config, executableName string) (string, bool)
- func ToolExecutables(conf config.Config, plugin plugins.Plugin, version toolversions.Version) (executables []string, err error)
- func Write(conf config.Config, plugin plugins.Plugin, version toolversions.Version, ...) error
- type NoExecutableForPluginError
- type NoVersionSetError
- type UnknownCommandError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecutableDirs ¶
ExecutableDirs returns a slice of directory names that tool executables are contained in
func ExecutableOnPath ¶
ExecutableOnPath returns the path to an executable if one is found on the provided paths. `path` must be in the same format as the `PATH` environment variable.
func ExecutablePaths ¶
func ExecutablePaths(conf config.Config, plugin plugins.Plugin, version toolversions.Version) ([]string, error)
ExecutablePaths returns a slice of absolute directory paths that tool executables are contained in.
func FindExecutable ¶
func FindExecutable(conf config.Config, shimName, currentDirectory string) (string, plugins.Plugin, string, bool, error)
FindExecutable takes a shim name and a current directory and returns the path to the executable that the shim resolves to.
func GenerateAll ¶
GenerateAll generates shims for all executables of every version of every plugin.
func GenerateForPluginVersions ¶
func GenerateForPluginVersions(conf config.Config, plugin plugins.Plugin, stdOut io.Writer, stdErr io.Writer) error
GenerateForPluginVersions generates all shims for all installed versions of a tool.
func GenerateForVersion ¶
func GenerateForVersion(conf config.Config, plugin plugins.Plugin, version toolversions.Version, stdOut io.Writer, stdErr io.Writer) error
GenerateForVersion loops over all the executable files found for a tool and generates a shim for each one
func GetExecutablePath ¶
func GetExecutablePath(conf config.Config, plugin plugins.Plugin, shimName string, version toolversions.Version) (string, error)
GetExecutablePath returns the path of the executable
func GetToolsAndVersionsFromShimFile ¶
func GetToolsAndVersionsFromShimFile(shimPath string) (versions []toolversions.ToolVersions, err error)
GetToolsAndVersionsFromShimFile takes a file path and parses out the tools and versions present in it and returns them as a slice containing info in ToolVersions structs.
func SystemExecutableOnPath ¶
SystemExecutableOnPath returns the path to the system executable if found, removes asdf shim directory from search
func ToolExecutables ¶
func ToolExecutables(conf config.Config, plugin plugins.Plugin, version toolversions.Version) (executables []string, err error)
ToolExecutables returns a slice of executables for a given tool version
Types ¶
type NoExecutableForPluginError ¶
type NoExecutableForPluginError struct {
// contains filtered or unexported fields
}
NoExecutableForPluginError is returned when a compatible version is found but no executable matching the name is located.
func (NoExecutableForPluginError) Error ¶
func (e NoExecutableForPluginError) Error() string
type NoVersionSetError ¶
type NoVersionSetError struct {
// contains filtered or unexported fields
}
NoVersionSetError is returned when shim is found but no version matches
func (NoVersionSetError) Error ¶
func (e NoVersionSetError) Error() string
type UnknownCommandError ¶
type UnknownCommandError struct {
// contains filtered or unexported fields
}
UnknownCommandError is an error returned when a shim is not found
func (UnknownCommandError) Error ¶
func (e UnknownCommandError) Error() string