versions

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package versions handles all operations pertaining to specific versions. Install, uninstall, etc...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllVersions

func AllVersions(plugin plugins.Plugin) (versions []string, err error)

AllVersions returns a slice of all available versions for the tool managed by the given plugin by invoking the plugin's list-all callback

func Install

func Install(conf config.Config, plugin plugins.Plugin, dir string, stdOut io.Writer, stdErr io.Writer) error

Install installs all specified versions of a tool for the current directory. Typically this will just be a single version, if not already installed, but it may be multiple versions if multiple versions for the tool are specified in the .tool-versions file.

func InstallAll

func InstallAll(conf config.Config, dir string, stdOut io.Writer, stdErr io.Writer) (failures []error)

InstallAll installs all specified versions of every tool for the current directory. Typically this will just be a single version, if not already installed, but it may be multiple versions if multiple versions for the tool are specified in the .tool-versions file.

func InstallOneVersion

func InstallOneVersion(conf config.Config, plugin plugins.Plugin, versionStr string, keepDownload bool, stdOut io.Writer, stdErr io.Writer) error

InstallOneVersion installs a specific version of a specific tool

func InstallVersion

func InstallVersion(conf config.Config, plugin plugins.Plugin, version toolversions.Version, stdOut io.Writer, stdErr io.Writer) error

InstallVersion installs a version of a specific tool, the version may be an exact version, or it may be `latest` or `latest` a regex query in order to select the latest version matching the provided pattern.

func Latest

func Latest(plugin plugins.Plugin, query string) (version string, err error)

Latest invokes the plugin's latest-stable callback if it exists and returns the version it returns. If the callback is missing it invokes the list-all callback and returns the last version matching the query, if a query is provided.

func Uninstall

func Uninstall(conf config.Config, plugin plugins.Plugin, rawVersion string, stdout, stderr io.Writer) error

Uninstall uninstalls a specific tool version. It invokes pre and post-uninstall hooks if set, and runs the plugin's uninstall callback if defined.

Types

type NoVersionSetError

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

NoVersionSetError is returned whenever an operation that requires a version is not able to resolve one.

func (NoVersionSetError) Error

func (e NoVersionSetError) Error() string

type UninstallableVersionError

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

UninstallableVersionError is an error returned if someone tries to install the system version.

func (UninstallableVersionError) Error

type VersionAlreadyInstalledError added in v0.16.3

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

VersionAlreadyInstalledError is returned whenever a version is already installed.

func (VersionAlreadyInstalledError) Error added in v0.16.3

Jump to

Keyboard shortcuts

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