installer

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddToPathTemporarillyEnvName string     = "VMR_ADD_TO_PATH_TEMPORARILY"
	ModeGlobally                 InvokeMode = "globally"
	ModeSessionly                InvokeMode = "sessionly"
	ModeToLock                   InvokeMode = "to-lock"
)
View Source
const (
	MinicondaSDKName string = "miniconda"
	CoursierSDKName  string = "coursier"
)
View Source
const (
	LockerFileName = ".vmr.lock"
)

Lock the version of an SDK for a project.

Variables

This section is empty.

Functions

func CheckAndInstallCoursier

func CheckAndInstallCoursier()

func CheckAndInstallMiniconda

func CheckAndInstallMiniconda()

func IsCoursierInstalled

func IsCoursierInstalled() bool

func IsMinicondaInstalled

func IsMinicondaInstalled() bool

func RemoveGlobalSDKPathTemporarily

func RemoveGlobalSDKPathTemporarily(sdkName string)

Remove the global SDK path from envs. Otherwise, it will shadow the hooked ones.

Types

type CachedFileFinder

type CachedFileFinder struct {
	SDKName     string
	VersionName string
}

Handle cached files.

func NewCachedFileFinder

func NewCachedFileFinder(sdkName string, versionName ...string) *CachedFileFinder

func (*CachedFileFinder) Delete

func (cf *CachedFileFinder) Delete()

type InstalledVersionFinder

type InstalledVersionFinder struct {
	SDKName           string
	InstalledVersions []string
	CurrentVersion    string
	Installer         *Installer
}

func NewIVFinder

func NewIVFinder(sdkName string) (i *InstalledVersionFinder)

func (*InstalledVersionFinder) FindAll

func (i *InstalledVersionFinder) FindAll() (r []string, current string)

func (*InstalledVersionFinder) UninstallAllVersions

func (i *InstalledVersionFinder) UninstallAllVersions()

type Installer

type Installer struct {
	OriginSDKName string
	VersionName   string
	Version       download.Item

	Shell shell.Sheller
	Mode  InvokeMode
	// contains filtered or unexported fields
}

SDK Installer.

func NewInstaller

func NewInstaller(originSDKName, versionName, intallSha256 string, version download.Item) (i *Installer)

func (*Installer) AddEnvsTemporarilly

func (i *Installer) AddEnvsTemporarilly()

func (*Installer) CollectEnvs

func (i *Installer) CollectEnvs(basePath string) map[string][]string
func (i *Installer) CreateSymlink()

func (*Installer) GetSDKInstaller

func (i *Installer) GetSDKInstaller() (si SDKInstaller)

func (*Installer) Install

func (i *Installer) Install()

func (*Installer) IsInstalled

func (i *Installer) IsInstalled() bool

func (*Installer) SetEnvGlobally

func (i *Installer) SetEnvGlobally()

func (*Installer) SetInvokeMode

func (i *Installer) SetInvokeMode(m InvokeMode)

func (*Installer) Uninstall

func (i *Installer) Uninstall()

func (*Installer) UnsetEnv

func (i *Installer) UnsetEnv()

type InvokeMode

type InvokeMode string

type SDKInstaller

type SDKInstaller interface {
	Initiate(originSDKName, versionName string, version download.Item)
	SetInstallConf(iconf download.InstallerConfig)
	FormatSDKName()
	GetInstallDir() string
	GetSymbolLinkPath() string
	Install()
}

type VersionLocker

type VersionLocker struct {
	VersionOfSDKs map[string]string
}

Lock the SDK version for a project.

func NewVLocker

func NewVLocker() (v *VersionLocker)

func (*VersionLocker) FindLockerFile

func (v *VersionLocker) FindLockerFile(dirPath ...string) string

func (*VersionLocker) HookForCdCommand

func (v *VersionLocker) HookForCdCommand()

Hook for cd command.

func (*VersionLocker) Load

func (v *VersionLocker) Load()

func (*VersionLocker) Save

func (v *VersionLocker) Save(sdkName, versionName string)

save lock info.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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