Documentation ¶
Index ¶
- Variables
- func CleanupStaleSrewInstallations(dir, currentVersion string) error
- func DisplayName(p index.Plugin) string
- func DisplayVersion(p index.Plugin) string
- func GetInstalledPluginReceipts(receiptsDir string) ([]index.Receipt, error)
- func GetMatchingPlatform(platforms []index.Platform) (index.Platform, bool, error)
- func Install(p environment.Paths, plugin index.Plugin, opts InstallOpts) error
- func InstalledPluginsFromIndex(receiptsDir, indexName string) ([]index.Receipt, error)
- func IsBinDirInPATH(paths environment.Paths) bool
- func IsWindows() bool
- func PrintWarning(w io.Writer, format string, a ...interface{})
- func SetupInstructions() string
- func SortByFirstColumn(rows [][]string) [][]string
- func ToPlatforms(s []string) ([]index.Platform, error)
- func ToPlugin(m []model.Detail) index.Plugin
- func ToPluginDetail(m map[string]interface{}) error
- func Uninstall(p environment.Paths, name string) error
- func Upgrade(p environment.Paths, plugin index.Plugin) error
- type InstallOpts
- type OSArchPair
Constants ¶
This section is empty.
Variables ¶
var ( ErrIsAlreadyInstalled = errors.New("can't install, the newest version is already installed") ErrIsNotInstalled = errors.New("plugin is not installed") ErrIsAlreadyUpgraded = errors.New("can't upgrade, the newest version is already installed") )
Plugin lifecycle errors
Functions ¶
func CleanupStaleSrewInstallations ¶
CleanupStaleSrewInstallations removes the versions that aren't the current version.
func DisplayName ¶
func DisplayVersion ¶
func GetInstalledPluginReceipts ¶
GetInstalledPluginReceipts returns a list of receipts.
func GetMatchingPlatform ¶
GetMatchingPlatform finds the platform spec in the specified plugin that matches the os/arch of the current machine (can be overridden via SREW_OS and/or SREW_ARCH).
func Install ¶
func Install(p environment.Paths, plugin index.Plugin, opts InstallOpts) error
Install will download and install a plugin. The operation tries to not get the plugin dir in a bad state if it fails during the process.
func InstalledPluginsFromIndex ¶
InstalledPluginsFromIndex returns a list of all install plugins from a particular index.
func IsBinDirInPATH ¶
func IsBinDirInPATH(paths environment.Paths) bool
func IsWindows ¶
func IsWindows() bool
IsWindows sees if SREW_OS or runtime.GOOS to find out if current execution mode is win32.
func PrintWarning ¶
func SetupInstructions ¶
func SetupInstructions() string
func SortByFirstColumn ¶
func ToPluginDetail ¶
Types ¶
type InstallOpts ¶
type InstallOpts struct {
ArchiveFileOverride string
}
InstallOpts specifies options for plugin installation operation.
type OSArchPair ¶
type OSArchPair struct {
OS, Arch string
}
OSArchPair is wrapper around operating system and architecture
func OSArch ¶
func OSArch() OSArchPair
OSArch returns the OS/arch combination to be used on the current system. It can be overridden by setting SREW_OS and/or SREW_ARCH environment variables.
func (OSArchPair) String ¶
func (p OSArchPair) String() string
String converts environment into a string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
todo(corneliusweig) remove migration code with v0.4
|
todo(corneliusweig) remove migration code with v0.4 |
Package semver is a wrapper for handling of semantic version (https://semver.org) values.
|
Package semver is a wrapper for handling of semantic version (https://semver.org) values. |
Package validation implements functions to validate Srew plugin types.
|
Package validation implements functions to validate Srew plugin types. |