Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
patinthehat committed May 14, 2024
1 parent 86b0d9a commit 4e55007
Showing 1 changed file with 34 additions and 18 deletions.
52 changes: 34 additions & 18 deletions DOCS.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
# Eget Documentation
# zeget Documentation

Eget works in four phases:
zeget works in several phases:

* Load: load cache and configuration.
* Query: query GitHub for the active rate limits.
* Find: determine a list of assets that may be installed.
* Detect: determine which asset in the list should be downloaded for the target system.
* Verify: verify the checksum of the asset if possible.
* Extract: determine which file within the asset to extract.

If you are interested in reading the source code, there is one file for each
phase, and the `eget.go` main file runs a routine that combines them all
together.
## Load

The Load phase loads the cache and configuration files. The cache file is a JSON
file that contains the last known rate limits and information on downloaded projects
such as the last release date, the last asset downloaded, etc. It's also used to save
previously selected assets for a project to avoid re-prompting the user for the same
information.

## Query

The Query phase queries `api.github.com` for the current rate limits. This is
done to ensure that the user does not exceed the rate limits of the GitHub API.

## Find

Expand All @@ -21,7 +32,7 @@ is provided, the Find phase just returns the direct URL without doing any work.

The Detect phase attempts to determine what OS and architecture each asset is
built for. This is done by matching a regular expression for each
OS/architecture that Eget knows about. The match rules are shown below, and are
OS/architecture that zeget knows about. The match rules are shown below, and are
case insensitive.

| OS | Match Rule |
Expand Down Expand Up @@ -49,30 +60,35 @@ If you would like a new OS/Architecture to be added, or find a case where the
auto-detection is not adequate (within reason), please open an issue.

Using the direct OS/Architecture (left column of the above tables) name in your
prebuilt zip file names will always allow Eget to auto-detect correctly,
although Eget will often auto-detect correctly for other names as well.
prebuilt zip file names will always allow zeget to auto-detect correctly,
although zeget will often auto-detect correctly for other names as well.

## Verify

During verification, Eget will attempt to verify the checksum of the downloaded
asset. If the user has provided a checksum, or asked Eget to simply print the
During verification, zeget will attempt to verify the checksum of the downloaded
asset. If the user has provided a checksum, or asked zeget to simply print the
checksum, it will do so. Otherwise it may do auto-detection. If it is
downloading an asset called `xxx`, and there is another asset called
`xxx.sha256` or `xxx.sha256sum`, Eget will automatically verify the SHA-256
`xxx.sha256` or `xxx.sha256sum`, zeget will automatically verify the SHA-256
checksum of the downloaded asset against the one contained in the
`.sha256`/`.sha256sum` file.
`.sha256`/`.sha256sum` file.

Similarly, if there is an asset called `checksums.txt`,
zeget will attempt to verify the checksum of the downloaded asset against the
one contained in the `checksums.txt` file, and assumes it was generated by
`sha256sum` or a similar tool.

## Extract

During extraction, Eget will detect the type of archive and compression, and
During extraction, zeget will detect the type of archive and compression, and
use this information to extract the requested file. If there is no requested
file, Eget will extract a file with executable permissions, with priority given
file, zeget will extract a file with executable permissions, with priority given
to files that have the same name as the repo. If multiple files with executable
permissions exist and none of them match the repo name, Eget will ask the user
to choose. Files ending in `.exe` are also assumed to be executable, regardless
of permissions within the archive.
permissions exist and none of them match the repo name, zeget will ask the user
to choose. Files ending in `.exe` or `.appimage` are also assumed to be executable,
regardless of permissions within the archive.

Eget supports the following filetypes for assets:
zeget supports the following filetypes for assets:

* `.tar.gz`/`.tgz`: tar archive with gzip compression.
* `.tar.bz2`: tar archive with bzip2 compression.
Expand Down

0 comments on commit 4e55007

Please sign in to comment.