Documentation ¶
Overview ¶
Package asdf provides a simple interface to the asdf version manager.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
func Install() error
Install installs all plugins and versions specified in local and global .tool-versions file.
func InstallPlugins ¶
InstallPlugins installs given plugins and version specified in local .tool-versions file or latest version if not specified.
func ListPluginVersions ¶
ListPluginVersions lists all installed versions of software for the specified plugin in ascending order.
Types ¶
type PluginVersions ¶
PluginVersions is a map of plugin name and version.
func ParseToolVersions ¶
func ParseToolVersions() (PluginVersions, error)
ParseToolVersions parses .tool-versions file and returns a map of plugin name and version.
func (PluginVersions) GetVersionOrDefault ¶
func (p PluginVersions) GetVersionOrDefault(plugin, withPrefix, defaultVersion string) string
GetVersionOrDefault returns the version of the plugin with given prefix if it exists in the map, otherwise returns the default version.
withPrefix is used to specify the prefix of the plugin version. For example, if the plugin version is 1.2.3, then withPrefix is `v` and the returned version will be `v1.2.3`. If withPrefix is empty, then the returned version will be `1.2.3`. This is useful when the plugin version is prefixed with a `v` and the plugin doesn't support it.
WithPrefix only applies to the returned version, not applied the default version.
type Plugins ¶
Plugins is a simple custom type to hold plugin name to quickly check if a plugin is already added.
func ListPlugins ¶
ListPlugins lists all plugins installed in asdf.