update

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package update checks GitHub Releases for a newer Kite build and can swap the running binary for the downloaded one. Kite ships as a portable single-file executable (no installer), so "update" means: download the new exe, rename the current one aside, move the new one into place, and relaunch -- the same rename+relaunch pattern Go self-updaters use, which works without admin rights on both Windows and Linux.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(info Info, onProgress func(Progress)) error

Apply downloads the platform asset referenced by a prior Check() result and swaps it in for the running executable, then relaunches it. Only call this after Check() reported Available -- it returns an error on any failure *before* relaunching; once the new process is successfully started, it does not return at all (the caller is expected to exit). onProgress may be nil; when set, it's called periodically during the download (never concurrently).

func CleanupOldBinary added in v0.10.3

func CleanupOldBinary()

CleanupOldBinary removes the previous executable Apply renamed aside. Apply can't delete it itself on Windows -- it's the image of the process that's still running at that point -- so the next launch does it.

Types

type Info

type Info struct {
	Available bool   `json:"available"`
	Current   string `json:"current"`
	Latest    string `json:"latest"`
	Notes     string `json:"notes"`
	// contains filtered or unexported fields
}

Info describes the result of a Check. downloadURL is deliberately unexported: it's only ever needed internally by Apply, and keeping it out of the struct's JSON encoding means it never crosses the Wails bridge to the frontend.

func Check

func Check(currentVersion string) (Info, error)

Check compares currentVersion (e.g. "v0.3.0", or "dev" for a local build) against the latest GitHub release tag for this platform.

type Progress

type Progress struct {
	Downloaded int64
	Total      int64
}

Progress reports download progress: Total is 0 if the server didn't send a Content-Length (progress is then indeterminate; report a spinner).

Jump to

Keyboard shortcuts

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