Skip to main content

Module update

Module update 

Source
Expand description

Self-update from GitHub Releases.

winx-code-agent update fetches the release metadata, downloads the bundle for this platform together with the published SHA256SUMS, verifies the digest, extracts the three sibling binaries, and swaps them in next to the running executable. Downloads go through the system curl and extraction through the system tar (bsdtar on Windows also reads zip archives), so the server binary carries no TLS stack of its own and inherits the user’s proxy configuration. Running daemons keep the old executables alive until they exit; restart-daemon picks up the new winxd, and guardians are replaced as their sessions end.

Structs§

Release
A published release and its downloadable assets.
ReleaseAsset
UpdateOptions
Options for run.
UpdateReport
What update decided and did.

Enums§

UpdateAction

Constants§

BINARIES
Sibling binaries every bundle must contain.
CHECKSUM_ASSET
Checksum manifest published with every release.
REPOSITORY
GitHub repository that publishes the release bundles.

Functions§

commit_binary
Move a staged file over destination. On Windows a running executable cannot be overwritten but can be renamed, so the old one moves aside first.
default_install_dir
Directory that holds the running executable, with symlinks resolved so the swap happens where the files really live.
fetch_release
Fetch release metadata for tag, or the latest release when None.
locate_binaries
Find the three sibling binaries under an extracted bundle.
parse_checksums
Parse a sha256sum-style manifest into file name -> lowercase hex digest.
parse_release
Parse the GitHub release API response.
platform_asset_name
Release asset built for this operating system and architecture.
replace_binary
Swap source into destination without ever leaving a half-written executable in place: stage_binary then commit_binary.
run
Resolve, verify, and install a release according to options.
stage_binary
Copy source to a private <destination>.new-<pid>-<random> (same directory, so the later rename is atomic) and mark it executable. Nothing in place changes yet, and no other process can hand us its file.
verify_checksum
Compare the digest of path against the manifest entry for asset_name.
version_is_newer
true when candidate is a strictly newer MAJOR.MINOR.PATCH than current. Unparseable versions never count as newer.