From: AJ ONeal Date: Mon, 4 May 2020 10:29:29 +0000 (-0600) Subject: update README.md X-Git-Url: https://git.josue.xyz/?p=webi-installers%2F.git;a=commitdiff_plain;h=fca1ef9dc61307236722e4292d5087cbf3e875ec update README.md --- diff --git a/README.md b/README.md index fce261f..f670634 100644 --- a/README.md +++ b/README.md @@ -8,22 +8,76 @@ Primary and community-submitted packages for - Should install to `./local/opt/-` - Should not need `sudo` (except perhaps for a one-time `setcap`, etc) - Follow the example of - + , + , or + - - Note: the version handling is nasty, we'd like to move this to an API +## Creating an Installer + +An install consists of 4 parts: + +1. Generate a list of releases by OS and ARCH + - For a Github releases example, see `ripgrep/releases.js` and + `_common/github.js` +2. A bash version check (to skip downloading if already installed) + - typically just 1 unique line of bash +3. A bash install (move files from the archive (zip, tar) to \$HOME/.local) + - also typically just 1 unique line of bash +4. Update PATH + - the `webi_path_add` bash function will work for bash, zsh, and fish + +The `webinstall.dev` server uses the list of releases returned by +`/releases.js` to generate a bash script with most necessary +variables and functions pre-defined. + +You just fill in the blanks. + +## Script API + +See `webi/template.bash` + +These variables will be set by the server: + +``` +WEBI_PKG=example@v1 +WEBI_NAME=example +WEBI_HOST=https://webinstall.dev +WEBI_RELEASES=https://webinstall.dev/api/releases/example@v1?os=macos&arch=amd64&pretty=true +WEBI_CSV=v1.0.2, +WEBI_VERSION=1.0.2 +WEBI_MAJOR=1 +WEBI_MINOR=0 +WEBI_PATCH=2 +WEBI_LTS= +WEBI_CHANNEL=stable +WEBI_EXT=tar +WEBI_PKG_URL=https://cdn.example.com/example-macos-amd64.tar.gz +WEBI_PKG_FILE=example-macos-amd64.tar.gz +``` + +```bash +WEBI_TMP=${WEBI_TMP:-"$(mktemp -d -t webinstall-foobar.XXXXXXXX)"} +``` + +```bash +webi_download # Downloads the selected release to $HOME/Downloads/.tar.gz +webi_extract # Extracts the download to /tmp/-/ +webi_path_add /new/path # Adds /new/path to PATH for bash, zsh, and fish +``` # Roadmap - Wrap release APIs to unify and expose - - [ ] Golang - - [ ] Node - - [ ] Flutter + - [x] Golang + - [x] Node + - [x] Flutter - Started at - [ ] git - Note: do all platforms expose tar/zip releases with the same URLs? - [ ] npm - - [ ] github (NOT until `git` is supported) + - [x] github (see ripgrep) + - [x] gitea (see serviceman) - [ ] Support git urls (i.e. `@github.com/node/node`) - (maybe `ghi node/node` for github specifically)