selfinstall

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plan

type Plan struct {
	ExecutablePath string
	InstallDir     string
	TargetPath     string
	ShellName      string
	ShellRCPath    string
	ShellSnippet   string
	PathContains   bool
}

func PlanInstall

func PlanInstall(executablePath, homeDir, pathEnv, shell string, create bool) (Plan, error)

func PlanInstallWith

func PlanInstallWith(
	executablePath, homeDir, pathEnv, shell string,
	create bool,
	stat func(string) (os.FileInfo, error),
	mkdirAll func(string, os.FileMode) error,
) (Plan, error)

func WithInstallDir

func WithInstallDir(plan Plan, homeDir, pathEnv, shell, installDir string) Plan

type Result

type Result struct {
	Plan            Plan
	Installed       bool
	Removed         bool
	ShellConfigured bool
	ShellUpdated    bool
}

func Install

func Install(plan Plan, updateShell bool) (Result, error)

func InstallWith

func InstallWith(
	plan Plan,
	updateShell bool,
	readFile func(string) ([]byte, error),
	writeFile func(string, []byte, os.FileMode) error,
	mkdirAll func(string, os.FileMode) error,
) (Result, error)

func Uninstall added in v0.2.0

func Uninstall(plan Plan) (Result, error)

func UninstallWith added in v0.2.0

func UninstallWith(
	plan Plan,
	readFile func(string) ([]byte, error),
	remove func(string) error,
) (Result, error)

Jump to

Keyboard shortcuts

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