Documentation
¶
Overview ¶
Package appupdate checks GitHub for a newer lich release and, on a Windows install no package manager owns, downloads and runs the release's installer. Everywhere else lich belongs to a package manager (a Linux package, Homebrew, Scoop), so this package only reports the update: the UI drives the install through that manager instead (see install.sh and the /restart endpoint), or points at the release page where it can name none.
Index ¶
Constants ¶
const ProgressEventName = "appupdate-progress"
ProgressEventName is the hub event Apply's phases ride on, for the toast.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Progress ¶
type Progress struct {
Phase string `json:"phase"`
Received int64 `json:"received"`
Total int64 `json:"total"`
}
Progress is one step of Apply: bytes received of total during the download (total is -1 when the asset came without a Content-Length), then the phase that has no percentage: "installer", where lich hands over to the Windows installer and closes.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service reports lich's own update state and applies self-updates where the binary is writable.
func New ¶
New returns a service that reports version as the running build and polls GitHub for the latest release. install runs a downloaded Windows installer; emit is the app's event hub.
type Status ¶
type Status struct {
CurrentVersion string `json:"currentVersion"`
LatestVersion string `json:"latestVersion"`
UpdateAvailable bool `json:"updateAvailable"`
CanSelfApply bool `json:"canSelfApply"`
ReleaseURL string `json:"releaseUrl"`
// InstallCommand is the shell command the UI pastes (never auto-runs) to
// update a package-manager-owned install; empty on the self-apply platforms.
InstallCommand string `json:"installCommand"`
}
Status is lich's install/update state, reported to the window.