Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyRelease(ctx context.Context, dir string, target *ReleaseTarget, out io.Writer) error
- func BootstrapMarkerPath(installRoot string) string
- func CheckoutUpdateCommands() []string
- func ChecksumFor(body []byte, name string) string
- func CopySkillsNoClobber(src, dst string) error
- func Home() string
- func ISO8601UTC(t time.Time) string
- func InstallBinaryPath(installDir string) string
- func InstallRootOf(homeDir string) string
- func InstalledRepository(dir string) string
- func InstallerCommand() string
- func InstallerCreated(root string) bool
- func IsFullSHA(value string) bool
- func IsSourceCheckout(root string) bool
- func LatestStableRelease(ctx context.Context, r Repo) string
- func LsRemote(ctx context.Context, r Repo) (map[string]string, error)
- func Main(opts Options, stdout, stderr *os.File) int
- func ReleaseArchiveName(version, goos, goarch string) string
- func RemoveUninstallEntry() (bool, error)
- func ReplaceFile(src, dest string) error
- func ResolvedPathsJSON(opts Options) (string, error)
- func SetupFromCheckout(ctx context.Context, checkout string, report func(string)) error
- func StageNames() []string
- func UnmanagedTreeDescription(root string) string
- func ValidStableTag(tag string) bool
- func WireShellPath(userHome, shell string, report func(string)) error
- func WriteInstallMethod(dir, method string) error
- func WriteInstalledRepository(dir, repoURL string) error
- type Event
- type LogStream
- type Options
- type ReleaseInfo
- type ReleasePlan
- type ReleaseQuery
- type ReleaseTarget
- type Repo
- type Runner
- type StageError
Constants ¶
const ( MethodScript = "script" MethodWinGet = "winget" MethodGit = "git" )
Install methods the install core stamps for the script ladder, the WinGet nested installer and a source checkout
const ( ReleaseOlder = -1 ReleaseSame = 0 ReleaseNewer = 1 )
Order of a release against the installed build
const BootstrapMarkerName = ".icebath-bootstrap-complete"
Bootstrap complete marker file name inside the install tree
const DefaultRepoURL = "https://github.com/nickheyer/icebath.git"
Repository the installer downloads releases from unless ICEBATH_REPO_URL names another
const InstallDirName = "icebath-agent"
Directory name of the install tree under the home
const InstallMethodFile = ".install_method"
Stamp file beside the binary naming how the tree was installed
const InstallRepoFile = ".install_repo"
File beside the binary naming the repository a release install updates from
const ShellPathMarker = "# Icebath Agent command"
Comment line the installer writes above each PATH line it appends
const (
UninstallEntryKey = `HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\nickheyer.icebath`
)
Apps and Features key and identity WinGet matches against the manifest's AppsAndFeaturesEntries
Variables ¶
var ErrUnknownBuild = errors.New("the release this binary was built from is unknown")
Failure of an install whose build names neither a release tag nor a commit an order can be read from
var ReleaseCompanionFiles = []string{"cli-config.yaml.example", ".env.example"}
Files a release archive carries beside the binary that an install keeps next to it, the commented config templates
Functions ¶
func ApplyRelease ¶
Downloads the target release's archive for this host, verifies its checksum and swaps its binary and config templates into dir
func BootstrapMarkerPath ¶
Bootstrap complete marker of an install tree
func CheckoutUpdateCommands ¶
func CheckoutUpdateCommands() []string
Commands that update a source checkout from inside it on this platform
func ChecksumFor ¶
sha256 of name in a checksums.txt body, empty when it is not listed
func CopySkillsNoClobber ¶
Copies a checkout's bundled skills into the home skills dir without replacing anything there
func Home ¶
func Home() string
Home the installer works in, the ICEBATH_HOME override first then the platform default
func ISO8601UTC ¶
UTC ISO 8601 with milliseconds, the completedAt format every receipt writer shares
func InstalledRepository ¶
Repository an install recorded, empty when it recorded none
func InstallerCommand ¶
func InstallerCommand() string
Command that installs icebath with the installer on this platform
func InstallerCreated ¶
Whether the tree carries the bootstrap marker the installer writes when it completes an install there
func IsSourceCheckout ¶
Whether the tree holds the source of the module this binary was built from
func LatestStableRelease ¶
Latest stable release tag, the API first, then the latest redirect, then the highest advertised vX.Y.Z tag
func ReleaseArchiveName ¶
Release archive name of a version for goos and goarch, the zip on Windows and the gzipped tar elsewhere
func RemoveUninstallEntry ¶
Removes nothing off Windows, which keeps no Apps and Features entries
func ReplaceFile ¶
Renames src over dest, moving a running Windows binary aside first
func ResolvedPathsJSON ¶
Paths this install would use as the JSON object install.ps1 -ShowResolvedPaths prints
func SetupFromCheckout ¶
Publishes a checkout's built binary as the icebath command, puts the user bin on PATH and seeds the skills dir
func UnmanagedTreeDescription ¶
Names a tree the installer did not create, a source checkout as one
func WireShellPath ¶
Puts the user bin on PATH in the login shell's startup files, Windows registering it through command publication
func WriteInstallMethod ¶
Writes the install method stamp beside the binary of a tree
func WriteInstalledRepository ¶
Records the repository an install's releases come from beside its binary
Types ¶
type Options ¶
type Options struct {
Channel string
Branch string
Commit string
Dir string
Home string
RepoURL string
Binary string
Version string
FromSelf bool
NonInteractive bool
Verbose bool
SkipBrowser bool
SkipComputerUse bool
InstallMethod string
}
Install options, the flags of the install scripts after renames
type ReleaseInfo ¶
Release identity an installed binary reports through install-self --release-info
func InstalledRelease ¶
func InstalledRelease(ctx context.Context, binary string) ReleaseInfo
Asks an installed binary which release it is, empty when it cannot answer
type ReleasePlan ¶
type ReleasePlan struct {
Installed ReleaseInfo
Target *ReleaseTarget
Order int
Ahead int
}
Release an update would move a binary install to and its order against the installed build
func PlanRelease ¶
func PlanRelease(ctx context.Context, dir, repoURL string, q ReleaseQuery) (*ReleasePlan, error)
Selects the release the query names and orders it against the binary installed in dir
type ReleaseQuery ¶
Releases an update chooses from, a pinned commit first, then the latest stable release, then the newest of a branch
type ReleaseTarget ¶
Release chosen for an install, its commit when known and its assets when the API answered
func (*ReleaseTarget) AssetDigest ¶
func (t *ReleaseTarget) AssetDigest(name string) string
sha256 an API asset digest names, empty when the listing carries none
func (*ReleaseTarget) AssetURL ¶
func (t *ReleaseTarget) AssetURL(name string) string
Download URL of a named asset, the API listing first then the conventional release path
func (*ReleaseTarget) ExpectedSHA256 ¶
Verified sha256 of a release asset from checksums.txt, refusing a disagreeing API digest
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runs install stages in process, reporting every line through the sink
type StageError ¶
type StageError struct {
Reason string
}
Failure of one stage with its reason
func (*StageError) Error ¶
func (e *StageError) Error() string