Expand description
§Ghola install
Finds the Ghola sidecar binary and installs it from the project’s GitHub releases.
Nothing here asks the user: the CLI asks first and calls
install_latest only on a yes.
An install takes the latest release of robot-accomplice/ghola, picks
the archive for this OS and CPU (ghola_<ver>_<os>_<arch>.tar.gz, or
.zip on Windows), checks its SHA-256 against the release’s
checksums.txt, and only then extracts ghola (ghola.exe) from the
archive root to install_dir. The file is written to a temporary
name and renamed into place. PATH is never changed: scope runs the
binary by its full path.
checksums.txt is not signed. The check proves the archive is the one
the release lists; HTTPS to GitHub is what ties the release to its
publisher. Every request, redirects included, must be HTTPS to a GitHub
host.
The download goes through a ReleaseSource, so tests use a fake
release and never touch the network.
Structs§
- Github
Releases - Downloads from GitHub over HTTPS. Any other URL, and any redirect to one, is refused.
- Target
- An OS and CPU, in the names Ghola’s release archives use.
Enums§
- Outcome
- What
install_latestdid.
Constants§
- GO_
INSTALL - The command that builds Ghola from source.
- GO_
PACKAGE - The Go package of the binary. The module root has no main package.
- LATEST_
RELEASE_ URL - The GitHub API URL of the latest release.
- RELEASES_
PAGE - The releases page, for installing by hand.
Traits§
- Release
Source - Where a download comes from.
Functions§
- allowed_
url - True when
urlis HTTPS to a GitHub host that serves releases. - expected_
sha256 - The SHA-256 that
checksums.txt(<hex> <file>lines) gives forfile. - find
- The Ghola binary: on PATH, else in
install_dir. - find_go
goon PATH, for building Ghola when no release archive fits.- go_
install - Builds Ghola with
go installintodir(throughGOBIN) and returns the binary’s path. - in_path
- The program
namein one of thepathfolders, with the platform’s executable suffix (ghola.exeon Windows). It looks in the folders itself: Windows has nowhich. - install_
dir - Where scope installs Ghola:
<scope home>/bin. - install_
latest - Installs the latest Ghola release for
targetintodir. - locate
- The Ghola binary: in a
pathfolder, else indir. - manual_
steps - How to install Ghola by hand, one line each.