mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-06-07 08:16:35 +00:00
Compare commits
15 Commits
fix-backgr
...
doc-instal
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5c265d8ee | ||
|
|
bd330897c1 | ||
|
|
80fc00de21 | ||
|
|
734455a6c5 | ||
|
|
d739ca89ba | ||
|
|
012661c935 | ||
|
|
303417d513 | ||
|
|
3e2e7f2f65 | ||
|
|
ca81127b93 | ||
|
|
3c8b66be55 | ||
|
|
8f9b9da4a3 | ||
|
|
81ffcf3182 | ||
|
|
3d1a75102f | ||
|
|
e6b3aec8c0 | ||
|
|
ed8058deb8 |
3
.github/ISSUE_TEMPLATE/new_installer.md
vendored
3
.github/ISSUE_TEMPLATE/new_installer.md
vendored
@@ -35,15 +35,18 @@ info, and doing a find and replace on a few file system path names.
|
||||
```
|
||||
2. Copy the example template and update with info from Official Releases:
|
||||
<https://github.com/___CHANGE/ME___/releases>
|
||||
|
||||
```bash
|
||||
rsync -av _example/ CHANGE-ME/
|
||||
```
|
||||
|
||||
- [ ] update `CHANGE-ME/release.js` to use the official repo
|
||||
- [ ] Learn how `CHANGE-ME` unpacks (i.e. as a single file? as a .tar.gz? as
|
||||
a .tar.gz with a folder named CHANGE-ME?)
|
||||
- [ ] find and replace to change the name
|
||||
- [ ] update `CHANGE-ME/install.sh` (see `bat` and `jq` as examples)
|
||||
- [ ] update `CHANGE-ME/install.ps1` (see `bat` and `jq` as examples)
|
||||
|
||||
3. Needs an updated tagline and cheat sheet
|
||||
- [ ] update `CHANGE-ME/README.md`
|
||||
- [ ] official URL
|
||||
|
||||
372
AGENTS.md
Normal file
372
AGENTS.md
Normal file
@@ -0,0 +1,372 @@
|
||||
# Webi Installers — Agent Guide
|
||||
|
||||
Webi installs dev tools to `~/.local/` without sudo. Each installer is a small
|
||||
package of 3-4 files. This guide tells you how to create and modify them.
|
||||
|
||||
## Why Webi Exists
|
||||
|
||||
Webi makes tool installation trivially repeatable for people who aren't
|
||||
sysadmins — freelance clients, junior devs, anyone who shouldn't have to care
|
||||
about PATH, permissions, or platform differences. Three things matter:
|
||||
|
||||
1. **Install without friction.** No sudo, no manual PATH edits, no "necessary
|
||||
but unimportant" steps leaking into the experience.
|
||||
2. **Know where things are.** The Files section tells you exactly what got
|
||||
created or modified. Nothing should be mysterious.
|
||||
3. **Copy-paste recipes.** The cheat sheet is what you'd send someone less
|
||||
experienced than yourself instead of a project's full README — scannable,
|
||||
concrete, easy to reference by name.
|
||||
|
||||
## Quick Start: Adding a New Installer
|
||||
|
||||
1. Identify the **package type** (see [Categories](#categories) below)
|
||||
2. Find an existing installer of the same type to use as a template
|
||||
3. Create `<name>/releases.js`, `install.sh`, `install.ps1`, `README.md`
|
||||
4. Test with the command in [Testing releases.js](#testing-releasesjs)
|
||||
5. Run formatters before committing (see [Code Style](#code-style))
|
||||
|
||||
## Directory Layout
|
||||
|
||||
```
|
||||
<package-name>/
|
||||
README.md # YAML frontmatter + docs
|
||||
releases.js # Fetches release metadata (Node.js)
|
||||
install.sh # POSIX shell installer (macOS/Linux)
|
||||
install.ps1 # PowerShell installer (Windows) — optional
|
||||
```
|
||||
|
||||
Key infrastructure directories (do not modify without good reason):
|
||||
|
||||
- `_webi/` — bootstrap templates, `normalize.js` (auto-detects OS/arch/ext from
|
||||
filenames)
|
||||
- `_common/` — shared JS: `github.js`, `githubish.js`, `gitea.js`, `fetcher.js`
|
||||
- `_example/` — canonical template for new packages
|
||||
- `_examples/` — specialized templates (goreleaser, xz-compressed)
|
||||
|
||||
## Categories
|
||||
|
||||
Ref: <https://github.com/webinstall/webi-installers/issues/412>
|
||||
|
||||
| Type | Description | Template to copy |
|
||||
| ----- | -------------------------------------- | ---------------- |
|
||||
| `bin` | Single binary in tar/zip | `koji`, `delta` |
|
||||
| `bin` | Single bare binary (no archive) | `arc`, `shfmt` |
|
||||
| `bin` | Goreleaser-style archives | `keypairs` |
|
||||
| 📦 | Self-contained package (bin/man/share) | `node`, `go` |
|
||||
| 📂 | Multiple binaries/scripts | `pg` |
|
||||
| 🔗 | Alias/redirect to another package | `ripgrep` → `rg` |
|
||||
| 📝 | Bespoke / custom install | `rustlang` |
|
||||
|
||||
## releases.js
|
||||
|
||||
Fetches release metadata and returns a normalized object. Most packages use
|
||||
GitHub releases:
|
||||
|
||||
```js
|
||||
'use strict';
|
||||
|
||||
var github = require('../_common/github.js');
|
||||
var owner = 'OWNER';
|
||||
var repo = 'REPO';
|
||||
|
||||
let Releases = module.exports;
|
||||
|
||||
Releases.latest = async function () {
|
||||
let all = await github(null, owner, repo);
|
||||
return all;
|
||||
};
|
||||
|
||||
Releases.sample = async function () {
|
||||
let normalize = require('../_webi/normalize.js');
|
||||
let all = await Releases.latest();
|
||||
all = normalize(all);
|
||||
all.releases = all.releases.slice(0, 5);
|
||||
return all;
|
||||
};
|
||||
|
||||
if (module === require.main) {
|
||||
(async function () {
|
||||
let samples = await Releases.sample();
|
||||
console.info(JSON.stringify(samples, null, 2));
|
||||
})();
|
||||
}
|
||||
```
|
||||
|
||||
### Common release transformations
|
||||
|
||||
**Strip version prefix** (monorepo or tool-prefixed tags):
|
||||
|
||||
```js
|
||||
// e.g. "tools/monorel/v0.6.5" → "v0.6.5"
|
||||
rel.version = rel.version.replace(/^tools\/monorel\//, '');
|
||||
|
||||
// e.g. "cli-v1.2.3" → "v1.2.3"
|
||||
rel.version = rel.version.replace(/^cli-/, '');
|
||||
```
|
||||
|
||||
**Filter releases** (monorepo with multiple tools, or unwanted assets):
|
||||
|
||||
```js
|
||||
all.releases = all.releases.filter(function (rel) {
|
||||
// Keep only releases for this tool
|
||||
return rel.version.startsWith('tools/monorel/');
|
||||
});
|
||||
```
|
||||
|
||||
Apply transformations inside `Releases.latest`, before returning `all`.
|
||||
|
||||
**Available sources** beyond `github.js`:
|
||||
|
||||
- `_common/gitea.js` — Gitea servers
|
||||
- `_common/git-tag.js` — Git tag listing
|
||||
- Custom fetch from any JSON API (see `go/releases.js`, `terraform/releases.js`)
|
||||
|
||||
### Testing releases.js
|
||||
|
||||
```sh
|
||||
node -e "
|
||||
let Releases = require('./<name>/releases.js');
|
||||
Releases.sample().then(function (all) {
|
||||
console.log(JSON.stringify(all, null, 2));
|
||||
});
|
||||
"
|
||||
```
|
||||
|
||||
Verify: versions are clean semver (`0.6.5` not `tools/monorel/v0.6.5`), OS/arch
|
||||
detected correctly, download URLs resolve.
|
||||
|
||||
## install.sh
|
||||
|
||||
POSIX shell (`sh`, not bash). Always wrapped in a function:
|
||||
|
||||
```sh
|
||||
#!/bin/sh
|
||||
# shellcheck disable=SC2034
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
__init_pkgname() {
|
||||
# These 6 variables are required
|
||||
pkg_cmd_name="cmd"
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/cmd"
|
||||
pkg_dst="$pkg_dst_cmd"
|
||||
|
||||
pkg_src_cmd="$HOME/.local/opt/cmd-v$WEBI_VERSION/bin/cmd"
|
||||
pkg_src_dir="$HOME/.local/opt/cmd-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
pkg_install() {
|
||||
mkdir -p "$(dirname "$pkg_src_cmd")"
|
||||
mv ./cmd "$pkg_src_cmd"
|
||||
}
|
||||
|
||||
pkg_get_current_version() {
|
||||
cmd --version 2> /dev/null | head -n 1 | cut -d' ' -f2
|
||||
}
|
||||
}
|
||||
|
||||
__init_pkgname
|
||||
```
|
||||
|
||||
### Framework variables available in install.sh
|
||||
|
||||
Set by the webi bootstrap (`_webi/package-install.tpl.sh`):
|
||||
|
||||
| Variable | Example | Description |
|
||||
| --------------- | ------------------- | --------------------- |
|
||||
| `WEBI_VERSION` | `1.2.3` | Selected version |
|
||||
| `WEBI_PKG_URL` | `https://...` | Download URL |
|
||||
| `WEBI_PKG_FILE` | `foo-v1.2.3.tar.gz` | Download filename |
|
||||
| `WEBI_OS` | `linux` | Detected OS |
|
||||
| `WEBI_ARCH` | `amd64` | Detected architecture |
|
||||
| `WEBI_EXT` | `tar.gz` | Archive extension |
|
||||
| `WEBI_CHANNEL` | `stable` | Release channel |
|
||||
| `PKG_NAME` | `foo` | Package name |
|
||||
|
||||
### Override functions
|
||||
|
||||
| Function | Purpose |
|
||||
| --------------------------- | --------------------------------------------- |
|
||||
| `pkg_install()` | **Required.** Move files to `$pkg_src` |
|
||||
| `pkg_get_current_version()` | Parse installed version from command output |
|
||||
| `pkg_post_install()` | Post-install setup (git config, shell config) |
|
||||
| `pkg_done_message()` | Custom completion message |
|
||||
| `pkg_link()` | Override default symlink behavior |
|
||||
| `pkg_pre_install()` | Custom pre-install logic |
|
||||
|
||||
### Framework helper functions
|
||||
|
||||
| Function | Purpose |
|
||||
| ------------------------ | ---------------------------------- |
|
||||
| `webi_download()` | Download package if not cached |
|
||||
| `webi_extract()` | Extract archive by extension |
|
||||
| `webi_path_add <dir>` | Add to PATH via envman |
|
||||
| `webi_link()` | Create versioned symlinks |
|
||||
| `webi_check_installed()` | Check if version already installed |
|
||||
|
||||
### pkg_install patterns
|
||||
|
||||
**Bare binary in archive root:**
|
||||
|
||||
```sh
|
||||
mv ./cmd "$pkg_src_cmd"
|
||||
```
|
||||
|
||||
**Binary in a subdirectory (goreleaser-style `cmd-OS-arch/cmd`):**
|
||||
|
||||
```sh
|
||||
mv ./cmd-*/cmd "$pkg_src_cmd"
|
||||
```
|
||||
|
||||
**Flexible detection (handles multiple archive layouts):**
|
||||
|
||||
```sh
|
||||
if test -f ./cmd; then
|
||||
mv ./cmd "$pkg_src_cmd"
|
||||
elif test -e ./cmd-*/cmd; then
|
||||
mv ./cmd-*/cmd "$pkg_src_cmd"
|
||||
elif test -e ./cmd-*; then
|
||||
mv ./cmd-* "$pkg_src_cmd"
|
||||
fi
|
||||
```
|
||||
|
||||
## install.ps1
|
||||
|
||||
PowerShell for Windows. Uses `$Env:` variables. See `_example/install.ps1` for
|
||||
the full template. Key differences from install.sh:
|
||||
|
||||
- Paths use backslashes, commands end in `.exe`
|
||||
- `$Env:USERPROFILE` instead of `$HOME`
|
||||
- `Test-Path`, `Move-Item`, `Copy-Item` instead of shell equivalents
|
||||
- Downloads go to `$Env:USERPROFILE\Downloads\webi\`
|
||||
- Temp work in `.local\tmp`, use `Push-Location`/`Pop-Location`
|
||||
- Symlinks done via `Copy-Item` (not actual symlinks)
|
||||
|
||||
## README.md
|
||||
|
||||
````markdown
|
||||
---
|
||||
title: toolname
|
||||
homepage: https://github.com/owner/repo
|
||||
tagline: |
|
||||
toolname: A short one-line description.
|
||||
---
|
||||
|
||||
To update or switch versions, run `webi toolname@stable` (or `@v2`, `@beta`,
|
||||
etc).
|
||||
|
||||
### Files
|
||||
|
||||
These are the files that are created and/or modified with this installer:
|
||||
|
||||
```text
|
||||
~/.config/envman/PATH.env
|
||||
~/.local/bin/toolname
|
||||
~/.local/opt/toolname-VERSION/bin/toolname
|
||||
```
|
||||
|
||||
## Cheat Sheet
|
||||
|
||||
> `toolname` does X. Brief description.
|
||||
|
||||
### How to use toolname
|
||||
|
||||
```sh
|
||||
toolname --example
|
||||
```
|
||||
````
|
||||
|
||||
Note: **Files goes above Cheat Sheet**, not inside it.
|
||||
|
||||
### Cheat Sheet tone and style
|
||||
|
||||
Webi cheat sheets are **opinionated quick-reference guides**, not comprehensive
|
||||
documentation. Think "colleague's sticky note" — not the project's official
|
||||
README.
|
||||
|
||||
The tool is the topic, but **the problem is the reason**. Cheat sheets are
|
||||
organized around tasks the reader already wants to do — the tool is how they get
|
||||
there. Headings reference the tool (the reader came to this page on purpose),
|
||||
but the content solves the underlying problem completely:
|
||||
|
||||
- "How to reverse proxy to Node" (caddy knowledge, not just node)
|
||||
- "How to run a Node app as a System Service" (serviceman knowledge)
|
||||
- "How to Enable Secure Remote Postgres Access" (openssl, pg_hba.conf, systemd)
|
||||
- "How to manually configure git to use delta" (gitconfig, not delta flags)
|
||||
- "How to make fish the default shell in iTerm2" (iTerm2 knowledge, not fish)
|
||||
|
||||
The reader's question is "how do I do X?" and the cheat sheet answers it
|
||||
completely — including configs, adjacent tools, and platform-specific
|
||||
variations. A goreleaser cheat sheet teaches you goreleaser YAML. A postgres
|
||||
cheat sheet teaches you pg_hba.conf, openssl certs, and systemd units.
|
||||
|
||||
Cheat sheets cross tool boundaries freely. Node's references caddy, serviceman,
|
||||
setcap-netbind, GitHub Actions. Postgres references serviceman, openrc, launchd.
|
||||
They link to each other's webi pages. The scope is "everything you need to
|
||||
accomplish this task," not "everything this one binary does."
|
||||
|
||||
They show the actual files and configs that matter — not documentation _about_
|
||||
configs, but the configs themselves, copy-pasteable, with inline comments
|
||||
explaining the non-obvious parts.
|
||||
|
||||
**Guidelines:**
|
||||
|
||||
- **Show the 3-5 things someone will actually do**, with copy-pasteable
|
||||
commands. Skip exhaustive flag lists and API docs.
|
||||
- **Lead with practical integration.** Show the exact `git config` lines, the
|
||||
exact hook script, the exact shell alias — don't just explain the feature and
|
||||
leave wiring up to the reader.
|
||||
- **Skip what they already know.** No need to re-explain what the tool is at
|
||||
length — the tagline and one-liner blockquote handle that. Get to the
|
||||
commands.
|
||||
- **Prefer concrete over abstract.** Instead of "you can configure X via a
|
||||
config file", show the config file contents.
|
||||
|
||||
## Shell Naming Conventions
|
||||
|
||||
**Variables:**
|
||||
|
||||
- `ALL_CAPS` — environment variables only (`PATH`, `HOME`, `WEBI_VERSION`)
|
||||
- `b_varname` — block-scoped (inside a function, loop, or conditional)
|
||||
- `g_varname` — global to the script (and sourced scripts)
|
||||
- `a_varname` — function arguments
|
||||
|
||||
**Functions and commands:**
|
||||
|
||||
- `fn_name` — helper functions (anything other than the script's main/entry
|
||||
function)
|
||||
- `cmd_name` — command aliases, e.g. `cmd_curl='curl --fail-with-body -sSL'`
|
||||
|
||||
## Code Style
|
||||
|
||||
Requires `node`, `shfmt`, `pwsh`, and `pwsh-essentials` (install all via webi).
|
||||
Run before committing:
|
||||
|
||||
```sh
|
||||
npm run fmt # prettier (JS/MD) + shfmt (sh) + pwsh-fmt (ps1)
|
||||
npm run lint # jshint + shellcheck + pwsh-lint
|
||||
```
|
||||
|
||||
Commit messages: `feat(<pkg>): add installer`, `fix(<pkg>): update install.sh`,
|
||||
`docs(<pkg>): add cheat sheet`.
|
||||
|
||||
## Naming Conventions
|
||||
|
||||
- The canonical package name is the **command name** you type: `go`, `node`,
|
||||
`rg`
|
||||
- The alternate/alias name is the project name: `golang`, `nodejs`, `ripgrep`
|
||||
- Package directories are lowercase with hyphens
|
||||
|
||||
## Common Pitfalls
|
||||
|
||||
- **Monorepo releases**: The GitHub API returns ALL releases for the repo. You
|
||||
must filter in `releases.js` and strip the tag prefix from the version.
|
||||
- **No `--version` flag**: Some tools lack version introspection. Comment out
|
||||
`pkg_get_current_version` — webi still works, it just can't skip reinstalls.
|
||||
- **normalize.js auto-detection**: OS/arch/ext are guessed from download
|
||||
filenames. If the tool uses non-standard naming, you may need to set `os`,
|
||||
`arch`, or `ext` explicitly in `releases.js`.
|
||||
- **Goreleaser archives**: Typically contain a bare binary at the archive root
|
||||
(not nested in a directory). Use `mv ./cmd "$pkg_src_cmd"`.
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
- You'll be asked to make changes if you don't run the code formatters and
|
||||
linters:
|
||||
|
||||
- Node / JavaScript:
|
||||
- [prettier](https://webinstall.dev/prettier)
|
||||
```sh
|
||||
@@ -21,7 +20,6 @@
|
||||
npm run lint
|
||||
```
|
||||
- Bash
|
||||
|
||||
- [shfmt](https://webinstall.dev/shfmt)
|
||||
```sh
|
||||
npm run shfmt
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading foobar from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing foobar"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -15,8 +15,8 @@ foreach ($my_dir in $my_dirs) {
|
||||
$my_ps1 = [System.IO.Path]::GetRelativePath($my_cwd, $my_file.FullName)
|
||||
$my_dir = [System.IO.Path]::GetDirectoryName($my_file.FullName)
|
||||
|
||||
if (-Not (Test-Path -PathType Leaf -Path $my_ps1) -or
|
||||
-Not (Test-Path -PathType Container -Path $my_dir)) {
|
||||
if (-not (Test-Path -PathType Leaf -Path $my_ps1) -or
|
||||
-not (Test-Path -PathType Container -Path $my_dir)) {
|
||||
Write-Host (" SKIP {0} (non-regular file or parent directory)" -f $my_ps1)
|
||||
continue
|
||||
}
|
||||
@@ -31,7 +31,7 @@ foreach ($my_dir in $my_dirs) {
|
||||
$my_new_file | Set-Content -Path $my_ps1
|
||||
|
||||
$my_new_file = $my_new_file + "`n"
|
||||
IF ($text -ne $my_new_file) {
|
||||
if ($text -ne $my_new_file) {
|
||||
$my_status = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ foreach ($my_dir in $my_dirs) {
|
||||
$my_ps1 = [System.IO.Path]::GetRelativePath($my_cwd, $my_file.FullName)
|
||||
$my_dir = [System.IO.Path]::GetDirectoryName($my_file.FullName)
|
||||
|
||||
if (-Not (Test-Path -PathType Leaf -Path $my_ps1) -or
|
||||
-Not (Test-Path -PathType Container -Path $my_dir)) {
|
||||
if (-not (Test-Path -PathType Leaf -Path $my_ps1) -or
|
||||
-not (Test-Path -PathType Container -Path $my_dir)) {
|
||||
Write-Host (" SKIP {0} (non-regular file or parent directory)" -f $my_ps1)
|
||||
continue
|
||||
}
|
||||
@@ -39,7 +39,7 @@ foreach ($my_dir in $my_dirs) {
|
||||
$my_new_file | Set-Content -Path $my_ps1
|
||||
|
||||
$my_new_file = $my_new_file + "`n"
|
||||
IF ($my_old_file -ne $my_new_file) {
|
||||
if ($my_old_file -ne $my_new_file) {
|
||||
$my_status = 1
|
||||
}
|
||||
}
|
||||
|
||||
442
_skills/installer/SKILL.md
Normal file
442
_skills/installer/SKILL.md
Normal file
@@ -0,0 +1,442 @@
|
||||
---
|
||||
name: installer
|
||||
description: >
|
||||
Create or update install.sh and install.ps1 scripts for a webi package.
|
||||
Use when adding a new package to webi-installers, or when an existing
|
||||
install script needs to be updated to match a changed archive structure.
|
||||
Covers discovering archive layout from GitHub releases, identifying the
|
||||
right install pattern (A–I), and writing both the POSIX shell and
|
||||
PowerShell scripts that the webi framework calls.
|
||||
Note: this skill covers install scripts only — writing releases.js /
|
||||
releases.conf (the release-fetcher config) is a separate concern.
|
||||
license: MIT
|
||||
compatibility: Requires git, curl, tar. GitHub API access needed for
|
||||
discovery phase. Designed for Claude Code in the webi-installers repo.
|
||||
metadata:
|
||||
author: AJ ONeal
|
||||
version: "1.1"
|
||||
---
|
||||
|
||||
# Webi Installer Skill
|
||||
|
||||
Write `install.sh` and `install.ps1` for a webi package. These scripts are
|
||||
called by the webi framework **after** it has already downloaded and verified
|
||||
the archive — your job is only to unpack and place the files.
|
||||
|
||||
> **Scope:** This skill covers `install.sh` and `install.ps1` only. A
|
||||
> separate `releases.js` / `releases.conf` file is needed to tell webi where
|
||||
> to fetch releases from. That config must already exist (or be written
|
||||
> separately) before these install scripts are useful.
|
||||
|
||||
## Quick overview
|
||||
|
||||
1. [Discover the archive layout](#1-discover-the-archive-layout) — inspect
|
||||
GitHub releases with `curl` + `tar -t` to understand what's inside.
|
||||
2. [Choose the install pattern](#2-choose-the-install-pattern) — nine
|
||||
patterns (A–I) cover almost every real-world case.
|
||||
3. [Write `install.sh`](#3-write-installsh) — POSIX shell, ~20–40 lines.
|
||||
4. [Write `install.ps1`](#4-write-installps1) — PowerShell, ~40–60 lines.
|
||||
5. [Check for classification issues](#5-check-for-classification-issues) —
|
||||
look for variant assets, non-standard OS/arch naming, or installer .exe
|
||||
files that need special handling.
|
||||
|
||||
Full reference: [`references/PATTERNS.md`](references/PATTERNS.md)
|
||||
Archive layout details: [`references/ARCHIVE-LAYOUTS.md`](references/ARCHIVE-LAYOUTS.md)
|
||||
Classification guide: [`references/CLASSIFICATION.md`](references/CLASSIFICATION.md)
|
||||
|
||||
---
|
||||
|
||||
## 1. Discover the archive layout
|
||||
|
||||
### Use the webi releases API (fastest, if the package already exists)
|
||||
|
||||
```sh
|
||||
# JSON with all releases for a package
|
||||
curl -s https://webinstall.dev/api/releases/bat.json | jq '.releases[:3]'
|
||||
```
|
||||
|
||||
Each entry has `name` (filename), `version`, `os`, `arch`, `ext`, `download`.
|
||||
|
||||
### Or inspect GitHub releases directly
|
||||
|
||||
```sh
|
||||
# List asset filenames for the latest release
|
||||
curl -s "https://api.github.com/repos/sharkdp/bat/releases?per_page=3" \
|
||||
| jq '.[0].assets[] | .name'
|
||||
```
|
||||
|
||||
### Inspect what's inside an archive
|
||||
|
||||
Download one representative asset and list its contents **without extracting**:
|
||||
|
||||
```sh
|
||||
# tar.gz / tar.xz
|
||||
curl -fsSL "$DOWNLOAD_URL" | tar -tz
|
||||
|
||||
# tar.zst (modern systems — GNU tar / bsdtar both support this)
|
||||
curl -fsSL "$DOWNLOAD_URL" | tar --zstd -tz
|
||||
|
||||
# zip
|
||||
curl -fsSL "$DOWNLOAD_URL" -o /tmp/pkg.zip && unzip -l /tmp/pkg.zip
|
||||
|
||||
# bare binary (no archive extension, e.g. jq-linux-amd64)
|
||||
# The file IS the binary — no unpacking needed. Set WEBI_SINGLE=true.
|
||||
```
|
||||
|
||||
Look for:
|
||||
- Is the binary at the top level or inside a subdirectory?
|
||||
- Does the subdirectory name include the version and/or triplet?
|
||||
- Are there completions (`completions/`, `autocomplete/`, `complete/`)?
|
||||
- Are there man pages (`*.1`, `doc/*.1`, `man/man1/`)?
|
||||
- Are there shared libraries (`.so`, `.dylib`, `.dll`) alongside the binary?
|
||||
- Is the binary name different from the package command name?
|
||||
|
||||
See [`references/ARCHIVE-LAYOUTS.md`](references/ARCHIVE-LAYOUTS.md) for
|
||||
what each pattern looks like, with real examples.
|
||||
|
||||
---
|
||||
|
||||
## 2. Choose the install pattern
|
||||
|
||||
| Pattern | Description | Examples |
|
||||
|---------|-------------|---------|
|
||||
| **A** | Bare binary (or binary+docs) at archive root | caddy, fzf, k9s, terraform |
|
||||
| **B** | Binary inside a version/triplet-named subdirectory | delta, shellcheck, trip, xsv |
|
||||
| **C** | Like B, plus shell completions and/or man pages | bat, fd, rg, sd, watchexec, zoxide |
|
||||
| **D** | Binary + shared libraries (bundled) | ollama (Linux), psql, sass, syncthing |
|
||||
| **E** | FHS-like layout (`bin/`, `share/man/`) | gh, pandoc |
|
||||
| **F** | Renamed binary needing install-time rename | pathman, yq |
|
||||
| **G** | Full SDK/toolchain (many files) | go, node, zig, flutter, julia |
|
||||
| **H** | .NET runtime bundle | pwsh |
|
||||
| **I** | Multi-binary distribution | dashcore, mutagen |
|
||||
|
||||
**Pattern A** is by far the most common (~28 packages). When in doubt,
|
||||
download the archive and `tar -tz` it before writing a single line of code.
|
||||
|
||||
---
|
||||
|
||||
## 3. Write `install.sh`
|
||||
|
||||
The framework (`_webi/package-install.tpl.sh`) handles: user-agent detection,
|
||||
version resolution, download, checksum verification, and PATH management.
|
||||
Your script is **injected into** the framework and provides the
|
||||
package-specific part: where to find the binary and how to move it.
|
||||
|
||||
### Script structure
|
||||
|
||||
Every `install.sh` wraps its definitions in an `__init_pkgname()` function
|
||||
and immediately calls it. This prevents variable leakage when the script is
|
||||
sourced by the framework:
|
||||
|
||||
```sh
|
||||
#!/bin/sh
|
||||
|
||||
__init_toolname() {
|
||||
set -e
|
||||
set -u
|
||||
|
||||
####################
|
||||
# Install toolname #
|
||||
####################
|
||||
|
||||
pkg_cmd_name="toolname"
|
||||
WEBI_SINGLE=true # if applicable — see below
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/toolname"
|
||||
pkg_dst="$pkg_dst_cmd"
|
||||
|
||||
pkg_src_cmd="$HOME/.local/opt/toolname-v$WEBI_VERSION/bin/toolname"
|
||||
pkg_src_dir="$HOME/.local/opt/toolname-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
pkg_install() {
|
||||
# ...
|
||||
}
|
||||
|
||||
pkg_get_current_version() {
|
||||
# ...
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__init_toolname
|
||||
```
|
||||
|
||||
### Variables
|
||||
|
||||
| Variable | Description |
|
||||
|----------|-------------|
|
||||
| `pkg_cmd_name` | The command name that ends up on `$PATH` |
|
||||
| `pkg_dst_cmd` | Final destination: `~/.local/bin/<cmd>` (the symlink) |
|
||||
| `pkg_dst` | Same as `pkg_dst_cmd` for single-binary packages; `~/.local/opt/<cmd>` for SDKs |
|
||||
| `pkg_src_cmd` | Versioned binary: `~/.local/opt/<pkg>-v<ver>/bin/<cmd>` |
|
||||
| `pkg_src_dir` | Versioned install dir: `~/.local/opt/<pkg>-v<ver>` |
|
||||
| `pkg_src` | Same as `pkg_src_cmd` for single-binary packages; same as `pkg_src_dir` for SDKs |
|
||||
|
||||
**Framework-derived (set by the framework before calling `pkg_install` — do not set manually):**
|
||||
- `pkg_src_bin` — `$(dirname "$pkg_src_cmd")` — the versioned `bin/` dir
|
||||
- `pkg_dst_bin` — `$(dirname "$pkg_dst_cmd")` — `~/.local/bin`
|
||||
|
||||
### `WEBI_SINGLE`
|
||||
|
||||
`WEBI_SINGLE=true` affects the default values the framework uses for
|
||||
`pkg_src` and `pkg_dst`, and how `webi_link()` creates the symlink:
|
||||
|
||||
- **With `WEBI_SINGLE=true`**: links the binary file directly:
|
||||
`~/.local/bin/cmd → ~/.local/opt/cmd-vX.Y.Z/bin/cmd`
|
||||
- **Without it (default)**: links the directory:
|
||||
`~/.local/opt/cmd → ~/.local/opt/cmd-vX.Y.Z`
|
||||
|
||||
Set `WEBI_SINGLE=true` when using the conventional Pattern A skeleton
|
||||
(where `pkg_src` and `pkg_dst` are not set to custom values). When you
|
||||
explicitly assign all six variables yourself (as in Patterns B–F),
|
||||
`WEBI_SINGLE` is not strictly required but can still be set for clarity.
|
||||
|
||||
Pattern G (SDKs) and Pattern H (.NET bundles) do NOT use `WEBI_SINGLE` —
|
||||
they define `pkg_link()` manually because the whole directory tree must
|
||||
be linked, not just a single binary.
|
||||
|
||||
### Required function: `pkg_install`
|
||||
|
||||
Moves files from the extracted archive into the versioned opt directory.
|
||||
The framework has already extracted the archive into a temp directory and
|
||||
`cd`'d into it before calling `pkg_install`.
|
||||
|
||||
```sh
|
||||
pkg_install() {
|
||||
mkdir -p "$pkg_src_bin"
|
||||
mv ./tool-*/tool "$pkg_src_cmd"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
```
|
||||
|
||||
### Recommended function: `pkg_get_current_version`
|
||||
|
||||
Used to detect whether the package is already installed at the right version:
|
||||
|
||||
```sh
|
||||
pkg_get_current_version() {
|
||||
# 'tool --version' output: "tool 1.2.3 (rev abc)"
|
||||
# trim to just the version number
|
||||
tool --version 2>/dev/null | head -n 1 | cut -d' ' -f2
|
||||
}
|
||||
```
|
||||
|
||||
### Skeletons by pattern
|
||||
|
||||
**Pattern A** — binary at archive root (`WEBI_SINGLE=true`):
|
||||
```sh
|
||||
WEBI_SINGLE=true
|
||||
pkg_install() {
|
||||
mkdir -p "$pkg_src_bin"
|
||||
mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
```
|
||||
Use `$pkg_cmd_name*` as the glob — it matches the binary and avoids
|
||||
accidentally moving LICENSE or README into the binary path.
|
||||
|
||||
**Pattern B** — binary inside a `tool-{ver}-{triplet}/` subdirectory:
|
||||
```sh
|
||||
WEBI_SINGLE=true
|
||||
pkg_install() {
|
||||
mkdir -p "$pkg_src_bin"
|
||||
mv ./tool-*/tool "$pkg_src_cmd"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
```
|
||||
|
||||
**Pattern C** — like B, plus completions and man pages.
|
||||
The completion directory and filename vary per package — always check
|
||||
`tar -tz` output first. Common variants: `completions/`, `autocomplete/`,
|
||||
`complete/`. See [`references/PATTERNS.md`](references/PATTERNS.md) for
|
||||
a full example with guards:
|
||||
```sh
|
||||
WEBI_SINGLE=true
|
||||
pkg_install() {
|
||||
mkdir -p "$pkg_src_bin"
|
||||
mv ./tool-*/tool "$pkg_src_cmd"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
|
||||
# bash completion (directory name varies — check tar -tz)
|
||||
if test -e ./tool-*/completions/tool.bash; then
|
||||
mkdir -p "$pkg_src_dir/share/bash-completion/completions"
|
||||
mv ./tool-*/completions/tool.bash \
|
||||
"$pkg_src_dir/share/bash-completion/completions/tool"
|
||||
fi
|
||||
if test -e ./tool-*/completions/tool.fish; then
|
||||
mkdir -p "$pkg_src_dir/share/fish/vendor_completions.d"
|
||||
mv ./tool-*/completions/tool.fish \
|
||||
"$pkg_src_dir/share/fish/vendor_completions.d/tool.fish"
|
||||
fi
|
||||
if test -e ./tool-*/completions/_tool; then
|
||||
mkdir -p "$pkg_src_dir/share/zsh/site-functions"
|
||||
mv ./tool-*/completions/_tool \
|
||||
"$pkg_src_dir/share/zsh/site-functions/_tool"
|
||||
fi
|
||||
if test -e ./tool-*/tool.1; then
|
||||
mkdir -p "$pkg_src_dir/share/man/man1"
|
||||
mv ./tool-*/tool.1 "$pkg_src_dir/share/man/man1/tool.1"
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
**Pattern D** — binary + shared libraries. The entire directory structure
|
||||
must be preserved. See [`references/PATTERNS.md`](references/PATTERNS.md)
|
||||
for the ollama and psql examples.
|
||||
|
||||
**Pattern E** — FHS layout (archive already has `bin/` and `share/`):
|
||||
```sh
|
||||
WEBI_SINGLE=true
|
||||
pkg_install() {
|
||||
mkdir -p "$(dirname "$pkg_src_dir")"
|
||||
mv ./tool-*/ "$pkg_src_dir"
|
||||
}
|
||||
```
|
||||
|
||||
**Pattern F** — binary needs rename (archive name ≠ command name).
|
||||
Use when the binary in the archive cannot be matched by `$pkg_cmd_name*`
|
||||
— e.g., `yq_linux_amd64` for a command named `yq`:
|
||||
```sh
|
||||
WEBI_SINGLE=true
|
||||
pkg_install() {
|
||||
mkdir -p "$pkg_src_bin"
|
||||
mv ./yq_* "$pkg_src_cmd"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
```
|
||||
|
||||
**Pattern G** — full SDK (do NOT set `WEBI_SINGLE`):
|
||||
```sh
|
||||
# pkg_src = directory, not a binary
|
||||
pkg_src="$pkg_src_dir"
|
||||
pkg_dst="$HOME/.local/opt/tool"
|
||||
|
||||
pkg_install() {
|
||||
mkdir -p "$(dirname "$pkg_src_dir")"
|
||||
mv ./tool-*/ "$pkg_src_dir"
|
||||
}
|
||||
|
||||
pkg_link() {
|
||||
rm -f "$pkg_dst"
|
||||
ln -s "$pkg_src" "$pkg_dst"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. Write `install.ps1`
|
||||
|
||||
A PowerShell framework template exists (`_webi/package-install.tpl.ps1`)
|
||||
and injects the `install.ps1` script at the `# {{ installer }}` placeholder.
|
||||
The template provides: error handling, directory setup, `Invoke-DownloadUrl`
|
||||
helper, and PATH management via `webi_path_add`. However, unlike the shell
|
||||
side, the PS1 framework does **not** download or extract the archive — the
|
||||
package script must handle that itself. The same path conventions apply
|
||||
(opt/bin layout), but Windows uses `Copy-Item` instead of symlinks for
|
||||
the final `bin/` step.
|
||||
|
||||
### Variable block (always at top)
|
||||
|
||||
```powershell
|
||||
$pkg_cmd_name = "tool"
|
||||
|
||||
$pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\tool.exe"
|
||||
$pkg_dst_bin = "$Env:USERPROFILE\.local\bin"
|
||||
$pkg_dst = "$pkg_dst_cmd"
|
||||
|
||||
$pkg_src_cmd = "$Env:USERPROFILE\.local\opt\tool-v$Env:WEBI_VERSION\bin\tool.exe"
|
||||
$pkg_src_bin = "$Env:USERPROFILE\.local\opt\tool-v$Env:WEBI_VERSION\bin"
|
||||
$pkg_src_dir = "$Env:USERPROFILE\.local\opt\tool-v$Env:WEBI_VERSION"
|
||||
$pkg_src = "$pkg_src_cmd"
|
||||
```
|
||||
|
||||
### Standard body
|
||||
|
||||
```powershell
|
||||
New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
if (!(Test-Path -Path "$pkg_download")) {
|
||||
Write-Output "Downloading tool from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing tool"
|
||||
|
||||
Push-Location .local\tmp
|
||||
Remove-Item -Path ".\tool-v*" -Recurse -ErrorAction Ignore
|
||||
|
||||
# Unpack — Windows BSD-tar handles zip too
|
||||
Write-Output "Unpacking $pkg_download"
|
||||
& tar xf "$pkg_download"
|
||||
|
||||
# Move binary into place — adjust glob for your archive structure
|
||||
Write-Output "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force | Out-Null
|
||||
Move-Item -Path ".\tool-*\tool.exe" -Destination "$pkg_src_bin"
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
# Windows has no symlinks in the webi sense — copy to bin/
|
||||
Write-Output "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'"
|
||||
Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore | Out-Null
|
||||
New-Item "$pkg_dst_bin" -ItemType Directory -Force | Out-Null
|
||||
Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
|
||||
```
|
||||
|
||||
For Pattern A (binary at archive root), change the `Move-Item` line to:
|
||||
```powershell
|
||||
Move-Item -Path ".\tool.exe" -Destination "$pkg_src_bin"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Check for classification issues
|
||||
|
||||
Before writing any scripts, scan the asset list for red flags:
|
||||
|
||||
### Non-standard OS/arch names in filenames
|
||||
|
||||
The webi classifier recognises most patterns automatically. Watch for:
|
||||
- `darwin` vs `macos` — both recognised; output normalised to `macos`
|
||||
- `x86_64` vs `amd64` — both recognised; output normalised to `amd64`
|
||||
- `aarch64` vs `arm64` — both recognised; output normalised to `arm64`
|
||||
- `armv7` (missing trailing `l`) — normalised to `armv7l`
|
||||
|
||||
These are handled automatically. Only flag them if the asset list contains
|
||||
something genuinely unusual that the classifier would not recognise.
|
||||
|
||||
### Variant assets needing tags
|
||||
|
||||
Flag if you see multiple assets for the same OS/arch that serve different
|
||||
hardware or runtime requirements:
|
||||
- **GPU variants**: `*-rocm*`, `*-cuda*`, `*-vulkan*` alongside a baseline build
|
||||
- **Windows installer**: `*Setup.exe` or `*Install.exe` alongside a bare `*.exe`
|
||||
- **Framework-dependent .NET**: `*-fxdependent*` vs self-contained
|
||||
- **AppImage**: `*.AppImage` — not supported by the webi installer
|
||||
- **Electron/GUI app**: `*.dmg` or `*.AppImage` that is a full GUI app, not a CLI
|
||||
|
||||
If you find variants, see [`references/CLASSIFICATION.md`](references/CLASSIFICATION.md)
|
||||
for how to write a variant tagger.
|
||||
|
||||
### Formats to drop
|
||||
|
||||
These are automatically filtered by the framework — no action needed:
|
||||
- `.deb`, `.rpm`, `.snap`, `.AppImage`
|
||||
- Checksums (`*.sha256`, `*.sha512`, `*.asc`, `*.sig`)
|
||||
- Source archives (`*-src.tar.gz`, `*.tar.gz` with no OS in name)
|
||||
|
||||
---
|
||||
|
||||
## Reference files
|
||||
|
||||
- [`references/PATTERNS.md`](references/PATTERNS.md) — detailed pattern
|
||||
descriptions with real package examples and complete install script snippets
|
||||
- [`references/ARCHIVE-LAYOUTS.md`](references/ARCHIVE-LAYOUTS.md) — actual
|
||||
`tar -t` output for representative packages in each pattern
|
||||
- [`references/CLASSIFICATION.md`](references/CLASSIFICATION.md) — when and
|
||||
how to write variant taggers; non-standard filename conventions
|
||||
289
_skills/installer/references/ARCHIVE-LAYOUTS.md
Normal file
289
_skills/installer/references/ARCHIVE-LAYOUTS.md
Normal file
@@ -0,0 +1,289 @@
|
||||
# Archive Layouts — Real Package Examples
|
||||
|
||||
Actual `tar -t` / `unzip -l` output for representative packages.
|
||||
Use these to calibrate your eye for what each pattern looks like.
|
||||
|
||||
---
|
||||
|
||||
## Pattern A — Flat archive (no subdirectory)
|
||||
|
||||
### caddy 2.9.1 — linux/amd64 tar.gz
|
||||
```
|
||||
caddy
|
||||
LICENSE
|
||||
README.md
|
||||
```
|
||||
Binary `caddy` is at the top level. Set `WEBI_SINGLE=true`.
|
||||
|
||||
### fzf 0.70.0 — linux/amd64 tar.gz
|
||||
```
|
||||
fzf
|
||||
```
|
||||
Minimal — just the binary.
|
||||
|
||||
### terraform 1.9.8 — linux/amd64 zip
|
||||
```
|
||||
terraform
|
||||
LICENSE.txt
|
||||
```
|
||||
Zip archive but same flat layout.
|
||||
|
||||
### k9s — linux/amd64 tar.gz
|
||||
```
|
||||
k9s
|
||||
LICENSE
|
||||
README.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Pattern B — Named subdirectory, binary only
|
||||
|
||||
### delta 0.18.2 — linux/amd64 tar.gz
|
||||
```
|
||||
delta-0.18.2-x86_64-unknown-linux-musl/
|
||||
delta-0.18.2-x86_64-unknown-linux-musl/delta
|
||||
delta-0.18.2-x86_64-unknown-linux-musl/LICENSE
|
||||
delta-0.18.2-x86_64-unknown-linux-musl/README.md
|
||||
```
|
||||
Glob to move: `./delta-*/delta`
|
||||
|
||||
### shellcheck 0.10.0 — linux/x86_64 tar.xz
|
||||
```
|
||||
shellcheck-v0.10.0/
|
||||
shellcheck-v0.10.0/shellcheck
|
||||
shellcheck-v0.10.0/LICENSE.txt
|
||||
shellcheck-v0.10.0/README.txt
|
||||
```
|
||||
Glob to move: `./shellcheck-*/shellcheck`
|
||||
|
||||
### xsv 0.13.0 — linux/x86_64 tar.gz
|
||||
```
|
||||
xsv-0.13.0-x86_64-unknown-linux-musl/
|
||||
xsv-0.13.0-x86_64-unknown-linux-musl/xsv
|
||||
xsv-0.13.0-x86_64-unknown-linux-musl/UNLICENSE
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Pattern C — Subdirectory + completions + man pages
|
||||
|
||||
### rg/ripgrep 14.1.1 — linux/amd64 tar.gz
|
||||
```
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/rg
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/complete/
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/complete/_rg
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/complete/_rg.ps1
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/complete/rg.bash
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/complete/rg.fish
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/doc/
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/doc/rg.1
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/doc/FAQ.md
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/doc/GUIDE.md
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/CHANGELOG.md
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/LICENSE-MIT
|
||||
ripgrep-14.1.1-x86_64-unknown-linux-musl/README.md
|
||||
```
|
||||
Note: completions are in `complete/` (not `completions/`). Man page is `doc/rg.1`.
|
||||
|
||||
### sd 1.1.0 — linux/x86_64 tar.gz
|
||||
```
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/sd
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/sd.1
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/completions/
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/completions/sd.bash
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/completions/sd.elv
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/completions/sd.fish
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/completions/_sd
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/completions/_sd.ps1
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/CHANGELOG.md
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/LICENSE
|
||||
sd-v1.1.0-x86_64-unknown-linux-musl/README.md
|
||||
```
|
||||
Note: man page `sd.1` is at subdirectory root. Completions in `completions/`.
|
||||
|
||||
### bat 0.26.1 — linux/amd64 tar.gz
|
||||
```
|
||||
bat-v0.26.1-x86_64-unknown-linux-musl/
|
||||
bat-v0.26.1-x86_64-unknown-linux-musl/bat
|
||||
bat-v0.26.1-x86_64-unknown-linux-musl/bat.1
|
||||
bat-v0.26.1-x86_64-unknown-linux-musl/autocomplete/
|
||||
bat-v0.26.1-x86_64-unknown-linux-musl/autocomplete/bat.bash
|
||||
bat-v0.26.1-x86_64-unknown-linux-musl/autocomplete/bat.fish
|
||||
bat-v0.26.1-x86_64-unknown-linux-musl/autocomplete/bat.zsh
|
||||
bat-v0.26.1-x86_64-unknown-linux-musl/LICENSE-APACHE
|
||||
bat-v0.26.1-x86_64-unknown-linux-musl/LICENSE-MIT
|
||||
bat-v0.26.1-x86_64-unknown-linux-musl/README.md
|
||||
```
|
||||
Note: completions in `autocomplete/` (not `completions/`). Zsh file is `bat.zsh` not `_bat`.
|
||||
|
||||
### goreleaser — linux/amd64 tar.gz
|
||||
```
|
||||
goreleaser
|
||||
completions/
|
||||
completions/goreleaser.bash
|
||||
completions/goreleaser.fish
|
||||
completions/goreleaser.zsh
|
||||
manpages/
|
||||
manpages/goreleaser.1.gz
|
||||
LICENSE.md
|
||||
README.md
|
||||
```
|
||||
Note: goreleaser uses Pattern A layout (binary at root, no subdirectory)
|
||||
but includes completions and a gzipped man page. Set `WEBI_SINGLE=true`;
|
||||
move completions and man page after the binary.
|
||||
|
||||
---
|
||||
|
||||
## Pattern D — Binary + shared libraries
|
||||
|
||||
### ollama 0.17.7 — linux/amd64 tar.zst
|
||||
```
|
||||
bin/
|
||||
bin/ollama
|
||||
lib/
|
||||
lib/ollama/
|
||||
lib/ollama/libggml-base.so
|
||||
lib/ollama/libggml-cpu-alderlake.so
|
||||
lib/ollama/libggml-cpu-haswell.so
|
||||
lib/ollama/libggml-cpu-icelake.so
|
||||
lib/ollama/libggml-cpu-sandybridge.so
|
||||
lib/ollama/libggml-cpu-skylakex.so
|
||||
lib/ollama/libggml-cpu-sse42.so
|
||||
lib/ollama/libggml-cpu-x64.so
|
||||
lib/ollama/cuda_v12/
|
||||
lib/ollama/cuda_v12/libcublas.so.12
|
||||
lib/ollama/cuda_v12/libcublasLt.so.12
|
||||
lib/ollama/cuda_v12/libcudart.so.12
|
||||
lib/ollama/cuda_v12/libggml-cuda.so
|
||||
... (66 files total)
|
||||
```
|
||||
Extract bin/ and lib/ directories separately or together.
|
||||
|
||||
### psql (postgres client) — linux/amd64 tar.gz
|
||||
```
|
||||
psql-17.2-linux-x86_64/
|
||||
psql-17.2-linux-x86_64/bin/
|
||||
psql-17.2-linux-x86_64/bin/psql
|
||||
psql-17.2-linux-x86_64/lib/
|
||||
psql-17.2-linux-x86_64/lib/libpq.so.5
|
||||
psql-17.2-linux-x86_64/lib/libz.so.1
|
||||
psql-17.2-linux-x86_64/lib/libzstd.so.1
|
||||
psql-17.2-linux-x86_64/lib/libssl.so.3
|
||||
psql-17.2-linux-x86_64/lib/libcrypto.so.3
|
||||
psql-17.2-linux-x86_64/include/
|
||||
... (75 files total)
|
||||
```
|
||||
Move the entire `psql-{ver}-{triplet}/` directory: `mv ./psql-*/ "$pkg_src_dir"`
|
||||
|
||||
---
|
||||
|
||||
## Pattern E — FHS layout
|
||||
|
||||
### gh 2.67.0 — linux/amd64 tar.gz
|
||||
```
|
||||
gh_2.67.0_linux_amd64/
|
||||
gh_2.67.0_linux_amd64/bin/
|
||||
gh_2.67.0_linux_amd64/bin/gh
|
||||
gh_2.67.0_linux_amd64/share/
|
||||
gh_2.67.0_linux_amd64/share/man/
|
||||
gh_2.67.0_linux_amd64/share/man/man1/
|
||||
gh_2.67.0_linux_amd64/share/man/man1/gh-actions-cache-delete.1
|
||||
gh_2.67.0_linux_amd64/share/man/man1/gh-actions-cache-list.1
|
||||
... (129 man pages)
|
||||
gh_2.67.0_linux_amd64/LICENSE
|
||||
```
|
||||
Move the entire `gh_*/` directory: `mv ./gh_*/ "$pkg_src_dir"`
|
||||
|
||||
---
|
||||
|
||||
## Pattern F — Binary needs rename
|
||||
|
||||
### yq — linux/amd64 tar.gz (WEBI_SINGLE=true)
|
||||
```
|
||||
yq_linux_amd64
|
||||
yq.1
|
||||
```
|
||||
Binary is `yq_linux_amd64` — must rename to `yq` during install.
|
||||
|
||||
### pathman 0.6.0 — linux/amd64 tar.gz (WEBI_SINGLE=true)
|
||||
```
|
||||
pathman-v0.6.0-linux-amd64_v1
|
||||
```
|
||||
Binary name includes the full release tag. Rename to `pathman`.
|
||||
|
||||
---
|
||||
|
||||
## Pattern G — Full SDK
|
||||
|
||||
### node 24.14.0 — linux/amd64 tar.xz
|
||||
```
|
||||
node-v24.14.0-linux-x64/
|
||||
node-v24.14.0-linux-x64/bin/
|
||||
node-v24.14.0-linux-x64/bin/node
|
||||
node-v24.14.0-linux-x64/bin/npm -> ../lib/node_modules/npm/bin/npm-cli.js
|
||||
node-v24.14.0-linux-x64/bin/npx -> ../lib/node_modules/npm/bin/npx-cli.js
|
||||
node-v24.14.0-linux-x64/include/
|
||||
node-v24.14.0-linux-x64/lib/
|
||||
node-v24.14.0-linux-x64/lib/node_modules/
|
||||
node-v24.14.0-linux-x64/share/
|
||||
... (thousands of files)
|
||||
```
|
||||
Move entire directory: `mv ./node-*/ "$pkg_src_dir"`
|
||||
|
||||
### go 1.24.1 — linux/amd64 tar.gz
|
||||
```
|
||||
go/
|
||||
go/bin/
|
||||
go/bin/go
|
||||
go/bin/gofmt
|
||||
go/src/
|
||||
go/pkg/
|
||||
... (thousands of files)
|
||||
```
|
||||
Note: go's archive root directory is literally `go/` with no version in the name.
|
||||
|
||||
---
|
||||
|
||||
## Pattern H — .NET runtime bundle
|
||||
|
||||
### pwsh 7.4.6 — linux/amd64 tar.gz
|
||||
```
|
||||
pwsh
|
||||
Accessibility.dll
|
||||
clrcompression.dll
|
||||
clrjit.dll
|
||||
createdump
|
||||
cs/
|
||||
cs/System.Private.CoreLib.resources.dll
|
||||
de/
|
||||
de/System.Private.CoreLib.resources.dll
|
||||
... (727 files, all in same flat directory)
|
||||
```
|
||||
No subdirectory. Move all files into `$pkg_src_bin/`.
|
||||
|
||||
---
|
||||
|
||||
## Inspecting archives yourself
|
||||
|
||||
```sh
|
||||
# tar.gz / tar.xz / tar.zst — list contents only (no extraction)
|
||||
curl -fsSL "$URL" | tar -tz | head -20
|
||||
|
||||
# zip
|
||||
curl -fsSL "$URL" -o /tmp/pkg.zip
|
||||
unzip -l /tmp/pkg.zip | head -20
|
||||
|
||||
# For a .zst file when tar doesn't support zstd natively:
|
||||
curl -fsSL "$URL" -o /tmp/pkg.tar.zst && zstd -dc /tmp/pkg.tar.zst | tar -tz | head -20
|
||||
```
|
||||
|
||||
**What to look for**:
|
||||
1. Is there a top-level directory? (Pattern B/C/D/E/G) or no directory? (Pattern A/F/H)
|
||||
2. What is the directory named? Does it contain version? triplet?
|
||||
3. Are there `completions/`, `autocomplete/`, `complete/` subdirs? (Pattern C)
|
||||
4. Are there `.so`/`.dylib`/`.dll` files? (Pattern D or H)
|
||||
5. Does the binary name match the command you want on PATH? (Pattern F if not)
|
||||
6. Is there a `bin/` directory at the top level? (Pattern E or G)
|
||||
183
_skills/installer/references/CLASSIFICATION.md
Normal file
183
_skills/installer/references/CLASSIFICATION.md
Normal file
@@ -0,0 +1,183 @@
|
||||
# Classification Reference
|
||||
|
||||
When to flag classification issues, what the webi classifier does automatically,
|
||||
and what needs manual annotation.
|
||||
|
||||
---
|
||||
|
||||
## What the classifier handles automatically
|
||||
|
||||
The webi classifier (`internal/classify/classify.go`) parses asset filenames
|
||||
using regex patterns and produces canonical `os`, `arch`, `libc`, and `ext`
|
||||
values. It handles the vast majority of packages with no configuration needed.
|
||||
|
||||
### OS recognition
|
||||
Filenames containing these terms are classified automatically:
|
||||
- `darwin`, `macos`, `osx`, `apple` → `macos` in legacy cache
|
||||
- `linux` → `linux`
|
||||
- `windows`, `win`, `win32`, `win64` → `windows`
|
||||
- `freebsd`, `openbsd`, `netbsd`, `dragonfly` → respective values
|
||||
- `.deb`, `.rpm`, `.snap` → `linux` (but dropped from legacy cache)
|
||||
- `.dmg`, `.app.zip` → `macos`
|
||||
|
||||
### Arch recognition
|
||||
Filenames containing these terms are classified automatically:
|
||||
- `x86_64`, `amd64`, `64bit`, `x64` → `amd64`
|
||||
- `aarch64`, `arm64` → `arm64`
|
||||
- `armv7`, `armv7l`, `armhf`, `gnueabihf` → `armv7l`
|
||||
- `armv6`, `armv6l` → `armv6l`
|
||||
- `i386`, `i686`, `386`, `x86` → `x86`
|
||||
- `universal`, `universal2` → `amd64` (fat binary; arm64 falls back to this)
|
||||
|
||||
### Format recognition
|
||||
- `.tar.gz`, `.tar.xz`, `.tar.zst`, `.tar.bz2`, `.zip`, `.7z` → compressed archive
|
||||
- `.pkg`, `.msi`, `.dmg` → platform installer
|
||||
- `.exe` → either bare binary or GUI installer (see below)
|
||||
- No extension in filename → bare binary (ext = `exe` in cache)
|
||||
|
||||
### Automatically dropped
|
||||
These asset types are recognised and excluded without any configuration:
|
||||
- Checksums: `*.sha256`, `*.sha512`, `*.md5`, `*.sha256sum`
|
||||
- Signatures: `*.asc`, `*.sig`, `*.cosign`, `*.sbom`
|
||||
- Source archives: files with `source`, `src` in the name but no OS
|
||||
- Package formats not supported by the Node installer: `.deb`, `.rpm`, `.snap`,
|
||||
`.AppImage`, `.apk`
|
||||
|
||||
---
|
||||
|
||||
## When you need to add configuration
|
||||
|
||||
### Variant assets
|
||||
|
||||
A **variant** is a secondary build that serves the same OS/arch as a baseline
|
||||
build but requires different hardware or runtime support. The Node.js installer
|
||||
can't choose between variants — it only knows OS, arch, and libc. Variants
|
||||
must be tagged and then excluded at export time.
|
||||
|
||||
**Common variants and how to identify them**:
|
||||
|
||||
| Variant | Filename pattern | Notes |
|
||||
|---------|-----------------|-------|
|
||||
| CUDA (GPU) | `*-cuda*`, `*cuda12*` | NVIDIA GPU support |
|
||||
| ROCm (GPU) | `*-rocm*` | AMD GPU support |
|
||||
| Vulkan | `*-vulkan*` | Cross-vendor GPU |
|
||||
| AppImage | `*.AppImage` | Linux sandboxed app |
|
||||
| .NET fxdependent | `*-fxdependent*` | Requires .NET runtime |
|
||||
| Windows installer | `*Setup.exe`, `*Install.exe` | GUI installer, not the binary |
|
||||
|
||||
**Rule**: if there are multiple assets for the same OS/arch combination and
|
||||
they serve the same users differently, they need variant tags. The baseline
|
||||
(most widely compatible) build should be kept; variants should be tagged and
|
||||
excluded.
|
||||
|
||||
**Example**: ollama publishes for linux/amd64:
|
||||
- `ollama-linux-amd64.tar.zst` — baseline (CPU + any GPU auto-detected)
|
||||
- `ollama-linux-amd64-rocm.tar.zst` — ROCm variant
|
||||
- `ollama-linux-amd64-jetpack6.tar.zst` — NVIDIA Jetson variant
|
||||
|
||||
Only the baseline is useful via webi. The ROCm and Jetpack builds should be
|
||||
tagged as variants and excluded.
|
||||
|
||||
---
|
||||
|
||||
### Windows .exe: bare binary vs GUI installer
|
||||
|
||||
`.exe` assets are ambiguous — they could be:
|
||||
1. A bare binary (the tool itself, run from command line)
|
||||
2. A GUI installer (runs a setup wizard, not useful for webi)
|
||||
|
||||
**How to tell**:
|
||||
- GUI installer: filename contains `Setup`, `Install`, `Installer`, `inno`, `nsis`
|
||||
- GUI installer: the tool also has a `.zip` or `.tar.gz` for Windows
|
||||
- Bare binary: filename matches the tool name with minimal decoration
|
||||
|
||||
**When you see both**, the `.zip`/archive build is what webi uses. The `.exe`
|
||||
installer should be tagged as a variant (`installer`) so it's excluded.
|
||||
|
||||
**When there's only a `.exe`** (no archive), it's probably the bare binary.
|
||||
Test by downloading and running it — a bare binary runs immediately.
|
||||
|
||||
---
|
||||
|
||||
### Packages with no OS/arch in filenames
|
||||
|
||||
Some packages (rare) release with minimal filename decoration. Examples:
|
||||
- `tool-v1.2.3.tar.gz` — no OS, no arch
|
||||
- `tool.tar.gz` — version not even in filename
|
||||
|
||||
These are usually source archives (not compiled binaries) and should be
|
||||
dropped entirely from the release list. If they are compiled binaries for a
|
||||
specific OS, the releases.js config needs an `asset_filter` key to match the
|
||||
right file, plus OS/arch metadata added.
|
||||
|
||||
---
|
||||
|
||||
### Non-standard OS naming in filenames
|
||||
|
||||
A few upstreams use unusual OS names:
|
||||
- `sunos` — should map to `solaris` (the webi classifier does this)
|
||||
- `osx` or `macosx` — recognised as `macos`
|
||||
- `apple-darwin` (Rust triplet) — recognised as `macos`
|
||||
|
||||
If a package uses a genuinely unknown OS string, the classifier will produce
|
||||
`os = ""` for that asset. Those entries are dropped from the legacy cache.
|
||||
|
||||
---
|
||||
|
||||
### Asset filter configuration
|
||||
|
||||
If GitHub releases for a package include multiple builds that would otherwise
|
||||
collide (e.g. `extended` vs non-extended for hugo, or specific project builds
|
||||
in a monorepo), add to the package's `releases.conf`:
|
||||
|
||||
```ini
|
||||
# Only include assets containing "extended" in the name
|
||||
asset_filter = extended
|
||||
|
||||
# Exclude assets containing "legacy" in the name
|
||||
asset_exclude = legacy
|
||||
```
|
||||
|
||||
These filters run before classification.
|
||||
|
||||
---
|
||||
|
||||
## Quick checklist when inspecting a new package
|
||||
|
||||
1. **Look at the latest 2–3 releases** on GitHub. Note all asset filenames.
|
||||
2. **Find the "standard" builds** — the ones a normal user would download for
|
||||
their OS. Usually there are ≤4 per OS (amd64, arm64, x86, armv7l).
|
||||
3. **Check for extras**:
|
||||
- Are there GPU-specific builds for the same OS/arch? → variant
|
||||
- Are there `.exe` installer files alongside a `.zip`? → variant
|
||||
- Are there `.deb`/`.rpm`/`.AppImage`? → auto-dropped, no action needed
|
||||
- Does the Windows build have no archive and only a bare `.exe`? → fine
|
||||
4. **Check OS/arch naming** — does the filename use standard terms, or
|
||||
something unusual that might confuse the classifier?
|
||||
5. **Check format changes** — do old releases use a different archive type
|
||||
or directory layout than recent ones? The install script may need to
|
||||
handle both.
|
||||
|
||||
---
|
||||
|
||||
## Canonical vocabulary reference
|
||||
|
||||
All cache output must use exactly these values.
|
||||
|
||||
**OS**: `macos`, `linux`, `windows`, `freebsd`, `openbsd`, `netbsd`,
|
||||
`dragonfly`, `aix`, `illumos`, `plan9`, `solaris`
|
||||
|
||||
**Arch**:
|
||||
- `amd64` (not `x86_64`)
|
||||
- `arm64` (not `aarch64`)
|
||||
- `armv7l` (not `armv7` — the `l` stands for little-endian; `uname -m` reports `armv7l`)
|
||||
- `armv6l` (not `armv6`)
|
||||
- `x86` (not `i386`, `i686`, `386`)
|
||||
- `mipsle` (not `mipsel`)
|
||||
- `mips64le` (not `mips64el`)
|
||||
- Other: `arm`, `ppc64le`, `ppc64`, `loong64`, `riscv64`, `s390x`, `mips`, `mips64`
|
||||
|
||||
**Libc**: `none` (static/Go/Zig — never empty), `gnu`, `musl`, `msvc`
|
||||
|
||||
**Ext**: `tar.gz`, `tar.xz`, `zip`, `exe`, `7z`, `pkg`, `msi`
|
||||
(no leading dot; `exe` for bare binaries with no file extension)
|
||||
388
_skills/installer/references/PATTERNS.md
Normal file
388
_skills/installer/references/PATTERNS.md
Normal file
@@ -0,0 +1,388 @@
|
||||
# Install Patterns Reference
|
||||
|
||||
Nine patterns cover the full range of webi packages. Pattern A is by far
|
||||
the most common. Check `tar -tz $ARCHIVE` before writing any code.
|
||||
|
||||
---
|
||||
|
||||
## Pattern A — Bare binary at archive root
|
||||
|
||||
The archive extracts directly to the current directory with no wrapper
|
||||
subdirectory. Binary (and optional LICENSE/README) is at the top level.
|
||||
|
||||
**Set `WEBI_SINGLE=true`** — tells the framework to link the binary file
|
||||
directly (`~/.local/bin/cmd → ~/.local/opt/cmd-vX/bin/cmd`) rather than
|
||||
linking the versioned directory.
|
||||
|
||||
Representative packages: caddy, fzf, k9s, terraform, sttr, lf, monorel,
|
||||
awless, bun, cilium, curlie, dashmsg, dotenv, dotenv-linter, ffuf,
|
||||
gitdeploy, gprox, grype, hugo, keypairs, koji, ots, runzip, sclient,
|
||||
sqlc, sqlpkg, uuidv7, xcaddy, deno
|
||||
|
||||
**install.sh**:
|
||||
```sh
|
||||
pkg_cmd_name="caddy"
|
||||
WEBI_SINGLE=true
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/caddy"
|
||||
pkg_dst="$pkg_dst_cmd"
|
||||
pkg_src_cmd="$HOME/.local/opt/caddy-v$WEBI_VERSION/bin/caddy"
|
||||
pkg_src_dir="$HOME/.local/opt/caddy-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
pkg_install() {
|
||||
mkdir -p "$pkg_src_bin"
|
||||
mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
|
||||
pkg_get_current_version() {
|
||||
caddy version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::'
|
||||
}
|
||||
```
|
||||
|
||||
**install.ps1** key lines:
|
||||
```powershell
|
||||
# No subdirectory — binary is at the top level of the archive
|
||||
Move-Item -Path ".\caddy.exe" -Destination "$pkg_src_bin"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Pattern B — Binary inside a version/triplet subdirectory
|
||||
|
||||
Archive extracts to a single directory named with the version and/or
|
||||
platform triplet. Binary (and docs) live inside that directory.
|
||||
|
||||
Representative packages: delta, hexyl, shellcheck, trip, xsv, kubectx, kubens
|
||||
|
||||
**Subdirectory naming conventions seen in the wild**:
|
||||
- `tool-{ver}-{triplet}/` — most Rust tools (delta, shellcheck, xsv)
|
||||
- `tool-{ver}/` — simpler version-only dirs
|
||||
- flat (no dir) — kubectx/kubens use flat archives despite being "B-ish"
|
||||
|
||||
**install.sh**:
|
||||
```sh
|
||||
pkg_cmd_name="delta"
|
||||
# WEBI_SINGLE not set (or false)
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/delta"
|
||||
pkg_dst="$pkg_dst_cmd"
|
||||
pkg_src_cmd="$HOME/.local/opt/delta-v$WEBI_VERSION/bin/delta"
|
||||
pkg_src_dir="$HOME/.local/opt/delta-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
pkg_install() {
|
||||
mkdir -p "$pkg_src_bin"
|
||||
mv ./delta-*/delta "$pkg_src_cmd"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
|
||||
pkg_get_current_version() {
|
||||
delta --version 2>/dev/null | head -n 1 | cut -d' ' -f2
|
||||
}
|
||||
```
|
||||
|
||||
**install.ps1** key lines:
|
||||
```powershell
|
||||
Move-Item -Path ".\delta-*\delta.exe" -Destination "$pkg_src_bin"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Pattern C — Subdirectory with binary + completions and/or man pages
|
||||
|
||||
Same as B but the archive also contains shell completions and/or man pages
|
||||
worth installing.
|
||||
|
||||
Representative packages: bat, fd, lsd, rg/ripgrep, sd, watchexec, zoxide
|
||||
|
||||
Note: goreleaser has a flat archive (Pattern A layout) but with completions at
|
||||
the archive root. See the goreleaser entry in ARCHIVE-LAYOUTS.md.
|
||||
|
||||
**Completion directory name varies by package**:
|
||||
- `completions/` — sd, watchexec, zoxide
|
||||
- `autocomplete/` — bat, fd, lsd
|
||||
- `complete/` — rg/ripgrep
|
||||
|
||||
**Completion filename conventions**:
|
||||
- Bash: `tool.bash`, `tool.bash-completion`, `_tool.bash`
|
||||
- Fish: `tool.fish`
|
||||
- Zsh: `_tool`
|
||||
- PowerShell: `_tool.ps1`, `tool.ps1`
|
||||
|
||||
**Man page location varies**:
|
||||
- `tool.1` at subdirectory root — sd, bat, fd, lsd
|
||||
- `doc/tool.1` — rg/ripgrep
|
||||
- `man/man1/tool.1` — zoxide (deepest path)
|
||||
|
||||
**install.sh** (rg as example):
|
||||
```sh
|
||||
pkg_cmd_name="rg"
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/rg"
|
||||
pkg_dst="$pkg_dst_cmd"
|
||||
pkg_src_cmd="$HOME/.local/opt/rg-v$WEBI_VERSION/bin/rg"
|
||||
pkg_src_dir="$HOME/.local/opt/rg-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
pkg_install() {
|
||||
mkdir -p "$pkg_src_bin"
|
||||
mv ./ripgrep-*/rg "$pkg_src_cmd"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
|
||||
# bash completion
|
||||
if test -e ./ripgrep-*/complete/rg.bash; then
|
||||
mkdir -p "$pkg_src_dir/share/bash-completion/completions"
|
||||
mv ./ripgrep-*/complete/rg.bash \
|
||||
"$pkg_src_dir/share/bash-completion/completions/rg"
|
||||
fi
|
||||
# fish completion
|
||||
if test -e ./ripgrep-*/complete/rg.fish; then
|
||||
mkdir -p "$pkg_src_dir/share/fish/vendor_completions.d"
|
||||
mv ./ripgrep-*/complete/rg.fish \
|
||||
"$pkg_src_dir/share/fish/vendor_completions.d/rg.fish"
|
||||
fi
|
||||
# zsh completion
|
||||
if test -e ./ripgrep-*/complete/_rg; then
|
||||
mkdir -p "$pkg_src_dir/share/zsh/site-functions"
|
||||
mv ./ripgrep-*/complete/_rg \
|
||||
"$pkg_src_dir/share/zsh/site-functions/_rg"
|
||||
fi
|
||||
# man page
|
||||
if test -e ./ripgrep-*/doc/rg.1; then
|
||||
mkdir -p "$pkg_src_dir/share/man/man1"
|
||||
mv ./ripgrep-*/doc/rg.1 "$pkg_src_dir/share/man/man1/rg.1"
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_get_current_version() {
|
||||
rg --version 2>/dev/null | head -n 1 | cut -d' ' -f2
|
||||
}
|
||||
```
|
||||
|
||||
**Note**: Completion paths in completions/man install are best-effort
|
||||
— use `if test -e ...` guards so the script still works on older releases
|
||||
that didn't include them.
|
||||
|
||||
---
|
||||
|
||||
## Pattern D — Binary + shared libraries
|
||||
|
||||
The package bundles shared libraries alongside the binary. The entire
|
||||
directory tree must be preserved.
|
||||
|
||||
Representative packages: ollama (Linux), psql/postgres, sass (Dart VM),
|
||||
syncthing, xz
|
||||
|
||||
**install.sh**:
|
||||
```sh
|
||||
pkg_cmd_name="ollama"
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/ollama"
|
||||
pkg_dst="$pkg_dst_cmd"
|
||||
pkg_src_cmd="$HOME/.local/opt/ollama-v$WEBI_VERSION/bin/ollama"
|
||||
pkg_src_dir="$HOME/.local/opt/ollama-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
pkg_install() {
|
||||
mkdir -p "$(dirname "$pkg_src_dir")"
|
||||
# Archive already has bin/ and lib/ layout
|
||||
mv ./bin "$pkg_src_dir/bin"
|
||||
mv ./lib "$pkg_src_dir/lib"
|
||||
}
|
||||
```
|
||||
|
||||
For psql (archive has a `psql-{ver}-{triplet}/` wrapper dir):
|
||||
```sh
|
||||
pkg_install() {
|
||||
mkdir -p "$(dirname "$pkg_src_dir")"
|
||||
mv ./psql-*/ "$pkg_src_dir"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Pattern E — FHS-like layout
|
||||
|
||||
Archive already follows `bin/`, `share/man/`, `share/doc/` hierarchy.
|
||||
Extract the whole thing directly into the versioned opt directory.
|
||||
|
||||
Representative packages: gh (GitHub CLI), pandoc
|
||||
|
||||
**install.sh**:
|
||||
```sh
|
||||
pkg_cmd_name="gh"
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/gh"
|
||||
pkg_dst="$pkg_dst_cmd"
|
||||
pkg_src_cmd="$HOME/.local/opt/gh-v$WEBI_VERSION/bin/gh"
|
||||
pkg_src_dir="$HOME/.local/opt/gh-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
pkg_install() {
|
||||
mkdir -p "$(dirname "$pkg_src_dir")"
|
||||
mv ./gh_*/ "$pkg_src_dir"
|
||||
}
|
||||
|
||||
pkg_get_current_version() {
|
||||
gh --version 2>/dev/null | head -n 1 | cut -d' ' -f3
|
||||
}
|
||||
```
|
||||
|
||||
No `chmod` needed — binary is already executable inside the archive.
|
||||
|
||||
---
|
||||
|
||||
## Pattern F — Binary needs rename
|
||||
|
||||
Binary in the archive doesn't match the expected command name.
|
||||
|
||||
Representative packages: pathman (`pathman-v0.6.0-linux-amd64_v1` → `pathman`),
|
||||
yq (`yq_linux_amd64` → `yq`)
|
||||
|
||||
**install.sh**:
|
||||
```sh
|
||||
pkg_cmd_name="yq"
|
||||
WEBI_SINGLE=true
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/yq"
|
||||
pkg_dst="$pkg_dst_cmd"
|
||||
pkg_src_cmd="$HOME/.local/opt/yq-v$WEBI_VERSION/bin/yq"
|
||||
pkg_src_dir="$HOME/.local/opt/yq-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
pkg_install() {
|
||||
mkdir -p "$pkg_src_bin"
|
||||
# Binary is named yq_linux_amd64 (or yq_darwin_amd64 etc)
|
||||
mv ./yq_* "$pkg_src_cmd"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Pattern G — Full SDK / toolchain
|
||||
|
||||
Archive contains a complete runtime or SDK (hundreds to thousands of files).
|
||||
The entire tree goes into opt; multiple binaries are linked from `bin/`.
|
||||
|
||||
Representative packages: go, node, zig, flutter, julia, cmake, tinygo
|
||||
|
||||
**install.sh** (node as example):
|
||||
```sh
|
||||
pkg_cmd_name="node"
|
||||
# NOTE: pkg_src points to the directory, not a binary
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/node"
|
||||
pkg_dst="$HOME/.local/opt/node" # versioned-dir symlink target
|
||||
|
||||
pkg_src_cmd="$HOME/.local/opt/node-v$WEBI_VERSION/bin/node"
|
||||
pkg_src_dir="$HOME/.local/opt/node-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_dir" # pkg_src = the directory
|
||||
|
||||
pkg_install() {
|
||||
mkdir -p "$(dirname "$pkg_src")"
|
||||
mv ./node-*/ "$pkg_src"
|
||||
}
|
||||
|
||||
pkg_link() {
|
||||
rm -f "$pkg_dst"
|
||||
ln -s "$pkg_src" "$pkg_dst"
|
||||
}
|
||||
|
||||
pkg_get_current_version() {
|
||||
node --version 2>/dev/null | head -n 1 | sed 's:^v::'
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Pattern H — .NET runtime bundle
|
||||
|
||||
Flat directory with one binary and hundreds of `.dll` files. The entire
|
||||
directory must be preserved. Like Pattern G (SDK) in structure — the
|
||||
versioned directory is the package root, with the binary directly inside
|
||||
(no `bin/` subdirectory). A `pkg_link()` creates the unversioned symlink.
|
||||
|
||||
Representative packages: pwsh (PowerShell Core)
|
||||
|
||||
**install.sh**:
|
||||
```sh
|
||||
pkg_cmd_name="pwsh"
|
||||
|
||||
# note: binary is at pkg_src_dir root, no bin/ subdirectory
|
||||
pkg_src_cmd="$HOME/.local/opt/pwsh-v$WEBI_VERSION/pwsh"
|
||||
pkg_src_dir="$HOME/.local/opt/pwsh-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_dir"
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/opt/pwsh/pwsh"
|
||||
pkg_dst="$HOME/.local/opt/pwsh"
|
||||
|
||||
pkg_install() {
|
||||
# Archive extracts flat — move all contents into the versioned dir
|
||||
mkdir -p "$pkg_src_dir"
|
||||
mv ./* "$pkg_src_dir"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
}
|
||||
|
||||
pkg_link() {
|
||||
rm -rf "$pkg_dst"
|
||||
ln -s "$pkg_src" "$pkg_dst"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Pattern I — Multi-binary distribution
|
||||
|
||||
Archive contains multiple related binaries. Install the primary one and
|
||||
link only that.
|
||||
|
||||
Representative packages: dashcore (dashd + dash-cli + dash-qt + ...),
|
||||
mutagen (mutagen + mutagen-agents.tar.gz)
|
||||
|
||||
**install.sh** (dashcore-style):
|
||||
```sh
|
||||
pkg_cmd_name="dashd"
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/dashd"
|
||||
pkg_dst="$pkg_dst_cmd"
|
||||
pkg_src_cmd="$HOME/.local/opt/dashcore-v$WEBI_VERSION/bin/dashd"
|
||||
pkg_src_dir="$HOME/.local/opt/dashcore-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
pkg_install() {
|
||||
mkdir -p "$(dirname "$pkg_src_dir")"
|
||||
mv ./dashcore-*/ "$pkg_src_dir"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Choosing between patterns
|
||||
|
||||
```
|
||||
Archive root contains a single binary (or binary + docs)?
|
||||
→ Pattern A (set WEBI_SINGLE=true)
|
||||
|
||||
Archive has a named subdirectory wrapping the binary?
|
||||
├─ Binary only inside subdir? → Pattern B
|
||||
├─ Binary + completions/man pages? → Pattern C
|
||||
└─ Binary + shared libraries (.so)? → Pattern D
|
||||
|
||||
Archive already has bin/ and share/ layout?
|
||||
→ Pattern E
|
||||
|
||||
Binary name doesn't match the command name?
|
||||
→ Pattern F (rename during install)
|
||||
|
||||
Archive is a full SDK (compiler, runtime, stdlib)?
|
||||
→ Pattern G (pkg_src = pkg_src_dir)
|
||||
|
||||
Flat directory with many DLLs (.NET)?
|
||||
→ Pattern H
|
||||
|
||||
Multiple binaries for a single distributed system?
|
||||
→ Pattern I
|
||||
```
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\.vim\pack\plugins\start")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\.vim\pack\plugins\start")) {
|
||||
New-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start" -ItemType Directory -Force | Out-Null
|
||||
}
|
||||
Remove-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start\example" -Recurse -ErrorAction Ignore
|
||||
|
||||
@@ -398,21 +398,15 @@ BuildsCacher.create = function ({ ALL_TERMS, installers, caches }) {
|
||||
return;
|
||||
}
|
||||
|
||||
projInfo = await getLatestBuilds(Releases, installersDir, cacheDir, name)
|
||||
.then(function () {
|
||||
let latestProjInfo = BuildsCacher.transformAndUpdate(
|
||||
name,
|
||||
projInfo,
|
||||
meta,
|
||||
date,
|
||||
bc,
|
||||
);
|
||||
bc._caches[name] = latestProjInfo;
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error(`Fail when fetching latest builds for '${name}'`);
|
||||
console.error(err);
|
||||
});
|
||||
projInfo = await getLatestBuilds(Releases, installersDir, cacheDir, name);
|
||||
let latestProjInfo = BuildsCacher.transformAndUpdate(
|
||||
name,
|
||||
projInfo,
|
||||
meta,
|
||||
date,
|
||||
bc,
|
||||
);
|
||||
bc._caches[name] = latestProjInfo;
|
||||
});
|
||||
|
||||
return projInfo;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
############################################################
|
||||
New-Item -Path "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
New-Item -Path "$Env:USERPROFILE\.local\bin" -ItemType Directory -Force | Out-Null
|
||||
IF ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
|
||||
if ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
|
||||
curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/webi/webi-pwsh.ps1" -o "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1"
|
||||
Set-ExecutionPolicy -Scope Process Bypass
|
||||
& "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1" "{{ exename }}"
|
||||
|
||||
@@ -45,15 +45,15 @@ $TDim = "${Esc}[2m"
|
||||
$TReset = "${Esc}[0m"
|
||||
|
||||
function Invoke-DownloadUrl {
|
||||
Param (
|
||||
param (
|
||||
[string]$URL,
|
||||
[string]$Params,
|
||||
[string]$Path,
|
||||
[switch]$Force
|
||||
)
|
||||
|
||||
IF (Test-Path -Path "$Path") {
|
||||
IF (-Not $Force.IsPresent) {
|
||||
if (Test-Path -Path "$Path") {
|
||||
if (-not $Force.IsPresent) {
|
||||
Write-Host " ${TDim}Found${TReset} $Path"
|
||||
return
|
||||
}
|
||||
@@ -65,7 +65,7 @@ function Invoke-DownloadUrl {
|
||||
|
||||
Write-Host " Downloading ${TDim}from${TReset}"
|
||||
Write-Host " ${TDim}${URL}${TReset}"
|
||||
IF ($Params.Length -ne 0) {
|
||||
if ($Params.Length -ne 0) {
|
||||
Write-Host " ?$Params"
|
||||
$URL = "${URL}?${Params}"
|
||||
}
|
||||
@@ -80,18 +80,18 @@ function Get-UserAgent {
|
||||
# This is the canonical CPU arch when the process is emulated
|
||||
$my_arch = "$Env:PROCESSOR_ARCHITEW6432"
|
||||
|
||||
IF ($my_arch -eq $null -or $my_arch -eq "") {
|
||||
if ($my_arch -eq $null -or $my_arch -eq "") {
|
||||
# This is the canonical CPU arch when the process is native
|
||||
$my_arch = "$Env:PROCESSOR_ARCHITECTURE"
|
||||
}
|
||||
|
||||
IF ($my_arch -eq "AMD64") {
|
||||
if ($my_arch -eq "AMD64") {
|
||||
# Because PowerShell is sometimes AMD64 on Windows 10 ARM
|
||||
# See https://oofhours.com/2020/02/04/powershell-on-windows-10-arm64/
|
||||
$my_os_arch = (Get-CimInstance -ClassName Win32_OperatingSystem).OSArchitecture
|
||||
|
||||
# Using -clike because of the trailing newline
|
||||
IF ($my_os_arch -clike "ARM 64*") {
|
||||
if ($my_os_arch -clike "ARM 64*") {
|
||||
$my_arch = "ARM64"
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ function webi_path_add($pathname) {
|
||||
$exists_in_path = $true
|
||||
}
|
||||
}
|
||||
if (-Not $exists_in_path) {
|
||||
if (-not $exists_in_path) {
|
||||
$all_user_paths = "${pathname};${all_user_paths}".Trim(';')
|
||||
[Environment]::SetEnvironmentVariable("Path", $all_user_paths, "User")
|
||||
$null = Sync-EnvPath
|
||||
|
||||
@@ -72,8 +72,8 @@ gc "feat: new feature"
|
||||
|
||||
### Common aliases
|
||||
|
||||
Use *alias*es to make other tools you find around webi even _more_ convenient
|
||||
⚡️ (and powerful 💪).
|
||||
Use *alias*es to make other tools you find around webi even _more_ convenient ⚡️
|
||||
(and powerful 💪).
|
||||
|
||||
```sh
|
||||
aliasman curl 'curlie'
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading archiver from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing archiver"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/pwsh
|
||||
|
||||
Write-Output "'archiver@$Env:WEBI_TAG' is an alias for 'arc@$Env:WEBI_VERSION'"
|
||||
IF ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
|
||||
if ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
|
||||
curl.exe -A MS -fsSL "$Env:WEBI_HOST/arc@$Env:WEBI_VERSION" | powershell
|
||||
|
||||
@@ -20,7 +20,7 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Checking for (or Installing) MSVC Runtime..."
|
||||
& "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1" vcruntime
|
||||
|
||||
@@ -29,7 +29,7 @@ IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing AtomicParsley"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading awless from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing awless"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
$VERNAME = "$Env:PKG_NAME-v$Env:WEBI_VERSION.exe"
|
||||
$EXENAME = "$Env:PKG_NAME.exe"
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part"
|
||||
& Move-Item "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part" "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
@@ -11,11 +11,11 @@ IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
|
||||
# Fetch MSVC Runtime
|
||||
Write-Output "Checking for MSVC Runtime..."
|
||||
IF (-not (Test-Path "\Windows\System32\vcruntime140.dll")) {
|
||||
if (-not (Test-Path "\Windows\System32\vcruntime140.dll")) {
|
||||
& "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1" vcruntime
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\.local\bin\$VERNAME")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\.local\bin\$VERNAME")) {
|
||||
Write-Output "Installing $Env:PKG_NAME"
|
||||
# TODO: temp directory
|
||||
|
||||
|
||||
@@ -6,15 +6,27 @@ var repo = 'bun';
|
||||
|
||||
module.exports = function () {
|
||||
return github(null, owner, repo).then(function (all) {
|
||||
// collect baseline asset names so we can prefer them over non-baseline
|
||||
// (baseline builds avoid SIGILL on older/container CPUs)
|
||||
let baselineNames = new Set();
|
||||
all.releases.forEach(function (r) {
|
||||
if (r.name.includes('-baseline')) {
|
||||
baselineNames.add(r.name.replace('-baseline', ''));
|
||||
}
|
||||
});
|
||||
|
||||
all.releases = all.releases
|
||||
.filter(function (r) {
|
||||
let isDebug = r.name.includes('-profile');
|
||||
if (isDebug) {
|
||||
if (r.name.includes('-profile')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let isAncient = r.name.includes('-baseline');
|
||||
if (isAncient) {
|
||||
if (r.name.endsWith('.txt') || r.name.endsWith('.asc')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// drop the non-baseline asset when a baseline twin exists
|
||||
if (!r.name.includes('-baseline') && baselineNames.has(r.name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,13 +34,15 @@ module.exports = function () {
|
||||
if (isMusl) {
|
||||
r._musl = true;
|
||||
r.libc = 'musl';
|
||||
} else if (r.os === 'linux') {
|
||||
} else if (r.name.includes('-linux-')) {
|
||||
r.libc = 'gnu';
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
.map(function (r) {
|
||||
// bun-linux-x64-baseline.zip => bun-linux-x64
|
||||
r.name = r.name.replace('-baseline', '').replace(/\.zip$/, '');
|
||||
// bun-v0.5.1 => v0.5.1
|
||||
r.version = r.version.replace(/bun-/g, '');
|
||||
return r;
|
||||
|
||||
@@ -1181,7 +1181,8 @@ To prevent search engine and browser confusion
|
||||
- _DO NOT_ prevent crawling via `robots.txt` \
|
||||
(counter-intuitive, but pages _must_ be crawled for links to _NOT_ be indexed)
|
||||
- _all_ domains using public TLS certs _will_ be indexed by default \
|
||||
(they are all linked to and crawled from various Certificate Transparency reports)
|
||||
(they are all linked to and crawled from various Certificate Transparency
|
||||
reports)
|
||||
- follow these guidelines even if the dev sites use HTTP Basic Auth
|
||||
|
||||
```Caddyfile
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading caddy from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing caddy"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading chromedriver from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing chromedriver"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -17,13 +17,13 @@ $pkg_src = "$pkg_src_cmd"
|
||||
New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading cilium from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing cilium"
|
||||
Push-Location .local\tmp
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$pkg_download")) {
|
||||
if (!(Test-Path -Path "$pkg_download")) {
|
||||
Write-Output "Downloading cmake from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_dir")) {
|
||||
if (!(Test-Path -Path "$pkg_src_dir")) {
|
||||
Write-Output "Installing cmake"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
$VERNAME = "$Env:PKG_NAME-v$Env:WEBI_VERSION.exe"
|
||||
$EXENAME = "$Env:PKG_NAME.exe"
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part"
|
||||
& Move-Item "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part" "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION\bin\$VERNAME")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION\bin\$VERNAME")) {
|
||||
Write-Output "Installing $Env:PKG_NAME"
|
||||
# TODO: temp directory
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$pkg_download")) {
|
||||
if (!(Test-Path -Path "$pkg_download")) {
|
||||
Write-Output "Downloading crabz from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing crabz"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
$VERNAME = "$Env:PKG_NAME-v$Env:WEBI_VERSION.exe"
|
||||
$EXENAME = "$Env:PKG_NAME.exe"
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part"
|
||||
& Move-Item "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part" "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\.local\bin\$VERNAME")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\.local\bin\$VERNAME")) {
|
||||
Write-Output "Installing $Env:PKG_NAME"
|
||||
# TODO: temp directory
|
||||
|
||||
|
||||
@@ -147,8 +147,8 @@ dash-qt \
|
||||
CoinJoin aids in preventing some bad actors and malicious observers being able
|
||||
to easily reconstruct details about your transactions from the publicly
|
||||
available data by creating many excess transactions. \
|
||||
(be aware, however, that dedicated bad actors can use sophisticated software that
|
||||
will reveal much of the same information over time)
|
||||
(be aware, however, that dedicated bad actors can use sophisticated software
|
||||
that will reveal much of the same information over time)
|
||||
|
||||
`dash-qt` does not enable CoinJoin mixing by default.
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading dashcore from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_dir")) {
|
||||
if (!(Test-Path -Path "$pkg_src_dir")) {
|
||||
Write-Output "Installing dashcore"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading dashd from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_dir")) {
|
||||
if (!(Test-Path -Path "$pkg_src_dir")) {
|
||||
Write-Output "Installing dashd"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading dashmsg from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing dashmsg"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading delta from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing delta"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -18,7 +18,7 @@ etc).
|
||||
The obligatory Hello World
|
||||
|
||||
```sh
|
||||
deno run https://deno.land/std/examples/welcome.ts
|
||||
deno run https://docs.deno.com/examples/scripts/hello_world.ts
|
||||
```
|
||||
|
||||
Run a local file
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
#Invoke-WebRequest https://nodejs.org/dist/v12.16.2/node-v12.16.2-win-x64.zip -OutFile node-v12.16.2-win-x64.zip
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part"
|
||||
& Move-Item "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part" "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION")) {
|
||||
Write-Output "Installing $Env:PKG_NAME"
|
||||
# TODO: temp directory
|
||||
|
||||
|
||||
@@ -20,18 +20,18 @@ $pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch MSVC Runtime
|
||||
Write-Output "Checking for MSVC Runtime..."
|
||||
IF (-not (Test-Path "\Windows\System32\vcruntime140.dll")) {
|
||||
if (-not (Test-Path "\Windows\System32\vcruntime140.dll")) {
|
||||
& "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1" vcruntime
|
||||
}
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$pkg_download")) {
|
||||
if (!(Test-Path -Path "$pkg_download")) {
|
||||
Write-Output "Downloading dotenv-linter from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing dotenv-linter"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading dotenv from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing dotenv"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
$VERNAME = "$Env:PKG_NAME-v$Env:WEBI_VERSION.exe"
|
||||
$EXENAME = "$Env:PKG_NAME.exe"
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part"
|
||||
& Move-Item "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part" "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\.local\bin\$VERNAME")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\.local\bin\$VERNAME")) {
|
||||
Write-Output "Installing $Env:PKG_NAME"
|
||||
# TODO: temp directory
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading ffmpeg from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
Move-Item -Path "$pkg_download.part" -Destination "$pkg_download" -Force
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing ffmpeg"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (-Not (Test-Path -Path "$pkg_download")) {
|
||||
if (-not (Test-Path -Path "$pkg_download")) {
|
||||
Write-Output "Downloading ffuf from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (-Not (Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (-not (Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing ffuf"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
$VERNAME = "$Env:PKG_NAME-v$Env:WEBI_VERSION.exe"
|
||||
$EXENAME = "$Env:PKG_NAME.exe"
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part"
|
||||
& Move-Item "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part" "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\.local\bin\$VERNAME")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\.local\bin\$VERNAME")) {
|
||||
Write-Output "Installing $Env:PKG_NAME"
|
||||
# TODO: temp directory
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading gh from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing gh"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/pwsh
|
||||
|
||||
Write-Output "'git-gpg-init@$Env:WEBI_TAG' is an alias for 'git-config-gpg@$Env:WEBI_VERSION'"
|
||||
IF ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
|
||||
if ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
|
||||
curl.exe -A MS -fsSL "$Env:WEBI_HOST/git-config-gpg@$Env:WEBI_VERSION" | powershell
|
||||
|
||||
@@ -11,13 +11,13 @@ $pkg_dst_cmd = "$pkg_dst\cmd\$pkg_cmd_name"
|
||||
$pkg_dst_bin = "$pkg_dst\cmd"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$pkg_download")) {
|
||||
if (!(Test-Path -Path "$pkg_download")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src")) {
|
||||
if (!(Test-Path -Path "$pkg_src")) {
|
||||
Write-Output "Installing $pkg_cmd_name"
|
||||
# TODO: temp directory
|
||||
|
||||
@@ -30,12 +30,12 @@ IF (!(Test-Path -Path "$pkg_src")) {
|
||||
# Unpack archive
|
||||
# Windows BSD-tar handles zip. Imagine that.
|
||||
Write-Output "Unpacking $pkg_download"
|
||||
IF (!(Test-Path -Path "$pkg_cmd_name-v$Env:WEBI_VERSION")) {
|
||||
if (!(Test-Path -Path "$pkg_cmd_name-v$Env:WEBI_VERSION")) {
|
||||
New-Item -Path "$pkg_cmd_name-v$Env:WEBI_VERSION" -ItemType Directory -Force | Out-Null
|
||||
}
|
||||
($none = Push-Location "$pkg_cmd_name-v$Env:WEBI_VERSION") | Out-Null
|
||||
($none = Push-Location "$pkg_cmd_name-v$Env:WEBI_VERSION") | Out-Null
|
||||
& tar xf "$pkg_download"
|
||||
($none = Pop-Location) | Out-Null
|
||||
($none = Pop-Location) | Out-Null
|
||||
|
||||
# Settle unpacked archive into place
|
||||
Write-Output "New Name: $pkg_cmd_name-v$Env:WEBI_VERSION"
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading gitdeploy from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing gitdeploy"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,19 +19,19 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
Write-Output "Checking for Git..."
|
||||
IF (-Not (Get-Command -Name "git" -ErrorAction Silent)) {
|
||||
if (-not (Get-Command -Name "git" -ErrorAction Silent)) {
|
||||
& "$HOME\.local\bin\webi-pwsh.ps1" git
|
||||
$null = Sync-EnvPath
|
||||
}
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading gitea from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing gitea"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -16,13 +16,13 @@ if (!(Get-Command "git.exe" -ErrorAction SilentlyContinue)) {
|
||||
}
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$pkg_download")) {
|
||||
if (!(Test-Path -Path "$pkg_download")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src")) {
|
||||
if (!(Test-Path -Path "$pkg_src")) {
|
||||
Write-Output "Installing $pkg_cmd_name"
|
||||
# TODO: temp directory
|
||||
|
||||
@@ -50,7 +50,7 @@ IF (!(Test-Path -Path "$pkg_src")) {
|
||||
Write-Output "Copying into '$pkg_dst' from '$pkg_src'"
|
||||
Remove-Item -Path "$pkg_dst" -Recurse -ErrorAction Ignore
|
||||
Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
|
||||
IF (!(Test-Path -Path go\bin)) { New-Item -Path go\bin -ItemType Directory -Force | Out-Null }
|
||||
if (!(Test-Path -Path go\bin)) { New-Item -Path go\bin -ItemType Directory -Force | Out-Null }
|
||||
|
||||
# Add to path
|
||||
webi_path_add ~/.local/opt/go/bin
|
||||
|
||||
@@ -16,13 +16,13 @@ if (!(Get-Command "git.exe" -ErrorAction SilentlyContinue)) {
|
||||
}
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$pkg_download")) {
|
||||
if (!(Test-Path -Path "$pkg_download")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src")) {
|
||||
if (!(Test-Path -Path "$pkg_src")) {
|
||||
Write-Output "Installing $pkg_cmd_name"
|
||||
# TODO: temp directory
|
||||
|
||||
@@ -50,7 +50,7 @@ IF (!(Test-Path -Path "$pkg_src")) {
|
||||
Write-Output "Copying into '$pkg_dst' from '$pkg_src'"
|
||||
Remove-Item -Path "$pkg_dst" -Recurse -ErrorAction Ignore
|
||||
Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
|
||||
IF (!(Test-Path -Path go\bin)) { New-Item -Path go\bin -ItemType Directory -Force | Out-Null }
|
||||
if (!(Test-Path -Path go\bin)) { New-Item -Path go\bin -ItemType Directory -Force | Out-Null }
|
||||
|
||||
# Add to path
|
||||
webi_path_add ~/.local/opt/go/bin
|
||||
|
||||
@@ -122,8 +122,8 @@ goreleaser --clean
|
||||
|
||||
Check the console output to make sure that there are no messages about a failed
|
||||
publish. \
|
||||
If all is well you should the git tag on the releases page updated with a ChangeLog
|
||||
and the published binaries.
|
||||
If all is well you should see the git tag on the releases page updated with a
|
||||
ChangeLog and the published binaries.
|
||||
|
||||
### How to Publish to Gitea and others
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading goreleaser from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing goreleaser"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
$ErrorActionPreference = 'stop'
|
||||
|
||||
function Install-WebiHostedScript () {
|
||||
Param(
|
||||
param(
|
||||
[string]$Package,
|
||||
[string]$ScriptName
|
||||
)
|
||||
@@ -31,15 +31,15 @@ Install-WebiHostedScript -Package "gpg-pubkey" -ScriptName "gpg-pubkey"
|
||||
#
|
||||
# Check the gpg exists
|
||||
#
|
||||
IF (-Not (Get-Command -Name "gpg" -ErrorAction SilentlyContinue)) {
|
||||
if (-not (Get-Command -Name "gpg" -ErrorAction SilentlyContinue)) {
|
||||
& "${Env:USERPROFILE}\.local\bin\webi-pwsh.ps1" gpg
|
||||
$Env:Path = [Environment]::GetEnvironmentVariable("Path", "User")
|
||||
|
||||
IF (-Not (Get-Command -Name "gpg" -ErrorAction SilentlyContinue)) {
|
||||
if (-not (Get-Command -Name "gpg" -ErrorAction SilentlyContinue)) {
|
||||
Write-Output ""
|
||||
Write-Output "(exited because gpg is not installed)"
|
||||
Write-Output ""
|
||||
Exit 1
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading gprox from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing gprox"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading grype from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing grype"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading hugo-extended from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing hugo-extended"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading hugo from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing hugo"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
$VERNAME = "$Env:PKG_NAME-v$Env:WEBI_VERSION.exe"
|
||||
$EXENAME = "$Env:PKG_NAME.exe"
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part"
|
||||
& Move-Item "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part" "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\.local\bin\$VERNAME")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\.local\bin\$VERNAME")) {
|
||||
Write-Output "Installing $Env:PKG_NAME"
|
||||
# TODO: temp directory
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$pkg_download")) {
|
||||
if (!(Test-Path -Path "$pkg_download")) {
|
||||
Write-Output "Downloading julia from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_dir")) {
|
||||
if (!(Test-Path -Path "$pkg_src_dir")) {
|
||||
Write-Output "Installing julia"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading k9s from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing k9s"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading keypairs from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing keypairs"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -17,13 +17,13 @@ $pkg_src = "$pkg_src_cmd"
|
||||
New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading kind from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing kind"
|
||||
Push-Location .local\tmp
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ You can use koji in one of two ways:
|
||||
Here's the shortlist of options we've found most useful:
|
||||
|
||||
```text
|
||||
-e, --emoji - use emoji for commit type (ex: `✨ feat:`)
|
||||
-e, --emoji - use emoji for commit summary (ex: `feat: ✨ ...`)
|
||||
-a, --autocomplete - guess 'scope' based on commit history (slow on large projects)
|
||||
--hook - expect to be run from 'git commit', rather than wrap it
|
||||
```
|
||||
@@ -72,8 +72,8 @@ git commit
|
||||
|
||||
### How to use Emoji
|
||||
|
||||
You can use `-e` (or `--emoji`) to prepend your commit message with the relevant
|
||||
emoji for the commit type:
|
||||
You can use `-e` (or `--emoji`) to prepend your commit message summary with the
|
||||
relevant emoji for the commit type:
|
||||
|
||||
```sh
|
||||
koji -e
|
||||
@@ -91,18 +91,20 @@ koji --emoji --hook
|
||||
You can also use _shortcodes_ (`:pinched_fingers:`) in the scope, summary, or
|
||||
body.
|
||||
|
||||
### How to configure Koji (custom emoji)
|
||||
### How to configure koji
|
||||
|
||||
You can add custom commit types via a `koji.toml` in the project directory.
|
||||
You can configure koji via a custom config passed with `--config`, a
|
||||
`.koji.toml` file in the project root, or a user config at
|
||||
`~/.config/koji/config.toml`.
|
||||
|
||||
For example:
|
||||
Here's an example of a custom commit type:
|
||||
|
||||
```toml
|
||||
[[commit_types]]
|
||||
name = "feat"
|
||||
name = "cust"
|
||||
emoji = "✨"
|
||||
description = "A new feature"
|
||||
description = "A custom commit type"
|
||||
```
|
||||
|
||||
The default emoji can be seen in
|
||||
The default configuration can be seen in
|
||||
[default.toml](https://github.com/cococonscious/koji/blob/main/meta/config/default.toml).
|
||||
|
||||
@@ -19,17 +19,28 @@ __init_koji() {
|
||||
# ~/.local/opt/koji-v1.5.0/bin
|
||||
mkdir -p "$(dirname "$pkg_src_cmd")"
|
||||
|
||||
# mv ./koji-*/koji ~/.local/opt/koji-v1.5.0/bin/koji
|
||||
mv ./koji-*/koji "$pkg_src_cmd"
|
||||
if test -f ./koji; then
|
||||
# mv koji ~/.local/opt/koji-v1.5.0/bin/koji
|
||||
mv ./koji "$pkg_src_cmd"
|
||||
elif test -e ./koji-*/koji; then
|
||||
# mv koji-1.4.0/koji ~/.local/opt/koji-v1.4.0/bin/koji
|
||||
mv ./koji-*/koji "$pkg_src_cmd"
|
||||
elif test -e ./koji-*; then
|
||||
# mv koji-linux-amd64 ~/.local/opt/koji-v1.2.0/bin/koji
|
||||
mv ./koji-* "$pkg_src_cmd"
|
||||
else
|
||||
echo >&2 "failed to find 'koji' exectutable"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# pkg_get_current_version is recommended, but (soon) not required
|
||||
pkg_get_current_version() {
|
||||
# 'koji version' has output in this format:
|
||||
# 'koji --version' has output in this format:
|
||||
# koji 1.5.0
|
||||
# This trims it down to just the version number:
|
||||
# 1.5.0
|
||||
koji --version 2> /dev/null | cut -c6-
|
||||
koji --version 2> /dev/null | head -n 1 | cut -d' ' -f2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading kubectx from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing kubectx"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading kubens from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing kubens"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -17,13 +17,13 @@ $pkg_src = "$pkg_src_cmd"
|
||||
New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading lf from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing lf"
|
||||
|
||||
Push-Location .local\tmp
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading lsd from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing lsd"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
165
monorel/README.md
Normal file
165
monorel/README.md
Normal file
@@ -0,0 +1,165 @@
|
||||
---
|
||||
title: monorel
|
||||
homepage: https://github.com/therootcompany/golib/tree/main/tools/monorel
|
||||
tagline: |
|
||||
monorel: Monorepo Release Tool for Go binaries.
|
||||
---
|
||||
|
||||
To update or switch versions, run `webi monorel@stable` (or `@v0.6`, `@beta`,
|
||||
etc).
|
||||
|
||||
### Files
|
||||
|
||||
These are the files that are created and/or modified with this installer:
|
||||
|
||||
```text
|
||||
~/.config/envman/PATH.env
|
||||
~/.local/bin/monorel
|
||||
~/.local/opt/monorel-VERSION/bin/monorel
|
||||
```
|
||||
|
||||
These are the files that monorel creates and/or modifies in your project:
|
||||
|
||||
```text
|
||||
<module>/.goreleaser.yaml
|
||||
.git/refs/tags/<module>/v*
|
||||
```
|
||||
|
||||
## Cheat Sheet
|
||||
|
||||
> `monorel` manages independently-versioned Go modules and releases in a single
|
||||
> repository — initializing goreleaser configs, bumping versions, and publishing
|
||||
> multi-arch releases.
|
||||
|
||||
### How to use monorel
|
||||
|
||||
```sh
|
||||
# Generate .goreleaser.yaml for all modules
|
||||
monorel init --recursive ./
|
||||
|
||||
# Tag the next patch version for all modules with new commits
|
||||
monorel bump --recursive ./
|
||||
|
||||
# Build, package, and publish GitHub releases for all binaries of a module
|
||||
monorel release --recursive ./tools/monorel
|
||||
```
|
||||
|
||||
### How monorepo versioning works
|
||||
|
||||
Each `go.mod` is an independently-versioned module. Tags use the module's path
|
||||
as a prefix, and each module with binaries gets a `.goreleaser.yaml`:
|
||||
|
||||
```text
|
||||
./
|
||||
├── go.mod # v0.1.1 (library-only)
|
||||
├── io/
|
||||
│ └── transform/
|
||||
│ └── gsheet2csv/
|
||||
│ ├── go.mod # io/transform/gsheet2csv/v1.0.5
|
||||
│ ├── .goreleaser.yaml
|
||||
│ └── cmd/
|
||||
│ ├── gsheet2csv/
|
||||
│ ├── gsheet2env/
|
||||
│ └── gsheet2tsv/
|
||||
└── tools/
|
||||
└── monorel/
|
||||
├── go.mod # tools/monorel/v1.0.0
|
||||
└── .goreleaser.yaml
|
||||
```
|
||||
|
||||
### `monorel init` vs `goreleaser init`
|
||||
|
||||
`goreleaser init` generates a config that assumes one module per repo and
|
||||
derives names and versions from the git tag. That breaks in a monorepo with
|
||||
prefixed tags. `monorel init` fixes this:
|
||||
|
||||
| | `goreleaser init` | `monorel init` |
|
||||
| ------------- | --------------------------- | --------------------------------------- |
|
||||
| Project name | `{{ .ProjectName }}` | Hard-coded binary name |
|
||||
| Version | Derived from git tag | `{{ .Env.VERSION }}` (plain semver) |
|
||||
| Publishing | goreleaser's built-in | Disabled; uses `gh release` instead |
|
||||
| Multiple bins | Manual config | Auto-discovered, shared via YAML anchor |
|
||||
| Monorepo tags | (requires Pro subscription) | Prefix-aware (`cmd/foo/v1.2.3`) |
|
||||
|
||||
### Generated `.goreleaser.yaml`: single binary
|
||||
|
||||
For a module with one binary (like `tools/monorel/`), the generated config has a
|
||||
single build entry:
|
||||
|
||||
```yaml
|
||||
builds:
|
||||
- id: monorel
|
||||
binary: monorel
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
ldflags:
|
||||
- >-
|
||||
-s -w -X main.version={{.Env.VERSION}} -X main.commit={{.Commit}} -X
|
||||
main.date={{.Date}}
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
- windows
|
||||
# ... and more
|
||||
|
||||
archives:
|
||||
- id: monorel
|
||||
ids: [monorel]
|
||||
# Hard-coded name instead of {{ .ProjectName }} — goreleaser derives
|
||||
# ProjectName from the prefixed tag, which would produce messy filenames.
|
||||
# {{ .Env.VERSION }} for the same reason — the raw tag version includes
|
||||
# the module path prefix.
|
||||
name_template: >-
|
||||
monorel_{{ .Env.VERSION }}_{{ title .Os }}_{{ .Arch }}
|
||||
|
||||
# goreleaser Pro would be needed to publish from a prefixed tag,
|
||||
# so monorel disables goreleaser's publisher and uses 'gh release' instead.
|
||||
release:
|
||||
disable: true
|
||||
```
|
||||
|
||||
### Generated `.goreleaser.yaml`: multiple binaries
|
||||
|
||||
When a module has several commands under `cmd/`, monorel generates a build entry
|
||||
per binary with shared settings via a YAML anchor:
|
||||
|
||||
```yaml
|
||||
builds:
|
||||
- id: gsheet2csv
|
||||
binary: gsheet2csv
|
||||
main: ./cmd/gsheet2csv
|
||||
<<: &build_defaults
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
ldflags:
|
||||
- >-
|
||||
-s -w -X main.version={{.Env.VERSION}}
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
- windows
|
||||
# ...
|
||||
- id: gsheet2env
|
||||
binary: gsheet2env
|
||||
main: ./cmd/gsheet2env
|
||||
<<: *build_defaults
|
||||
- id: gsheet2tsv
|
||||
binary: gsheet2tsv
|
||||
main: ./cmd/gsheet2tsv
|
||||
<<: *build_defaults
|
||||
|
||||
archives:
|
||||
- id: gsheet2csv
|
||||
# All binaries are bundled into one archive per platform.
|
||||
ids: [gsheet2csv, gsheet2env, gsheet2tsv]
|
||||
# Same hard-coded name and {{ .Env.VERSION }} to avoid prefixed tag leaking.
|
||||
name_template: >-
|
||||
gsheet2csv_{{ .Env.VERSION }}_{{ title .Os }}_{{ .Arch }}
|
||||
|
||||
# Same as single binary — disable goreleaser's publisher for monorepo tags.
|
||||
release:
|
||||
disable: true
|
||||
```
|
||||
|
||||
All three binaries share one version tag (`io/transform/gsheet2csv/v1.0.5`) and
|
||||
one GitHub release.
|
||||
48
monorel/install.ps1
Normal file
48
monorel/install.ps1
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
$pkg_cmd_name = "monorel"
|
||||
|
||||
$pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\monorel.exe"
|
||||
$pkg_dst = "$pkg_dst_cmd"
|
||||
|
||||
$pkg_src_cmd = "$Env:USERPROFILE\.local\opt\monorel-v$Env:WEBI_VERSION\bin\monorel.exe"
|
||||
$pkg_src_bin = "$Env:USERPROFILE\.local\opt\monorel-v$Env:WEBI_VERSION\bin"
|
||||
$pkg_src_dir = "$Env:USERPROFILE\.local\opt\monorel-v$Env:WEBI_VERSION"
|
||||
$pkg_src = "$pkg_src_cmd"
|
||||
|
||||
New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading monorel from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing monorel"
|
||||
|
||||
# Enter tmp
|
||||
Push-Location .local\tmp
|
||||
|
||||
# Remove any leftover tmp cruft
|
||||
Remove-Item -Path ".\monorel-v*" -Recurse -ErrorAction Ignore
|
||||
Remove-Item -Path ".\monorel.exe" -Recurse -ErrorAction Ignore
|
||||
|
||||
# Unpack archive
|
||||
Write-Output "Unpacking $pkg_download"
|
||||
& tar xf "$pkg_download"
|
||||
|
||||
# Settle unpacked archive into place
|
||||
Write-Output "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force | Out-Null
|
||||
Move-Item -Path ".\monorel.exe" -Destination "$pkg_src_bin"
|
||||
|
||||
# Exit tmp
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
Write-Output "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'"
|
||||
Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore | Out-Null
|
||||
Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
|
||||
57
monorel/install.sh
Normal file
57
monorel/install.sh
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=SC2034
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
__init_monorel() {
|
||||
pkg_cmd_name="monorel"
|
||||
|
||||
pkg_src_dir="$HOME/.local/opt/monorel-v$WEBI_VERSION"
|
||||
pkg_src_cmd="$pkg_src_dir/bin/monorel"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/monorel"
|
||||
pkg_dst="$pkg_dst_cmd"
|
||||
|
||||
# pkg_install must be defined by every package
|
||||
pkg_install() {
|
||||
# ~/.local/opt/monorel-v0.6.5/bin
|
||||
mkdir -p "$(dirname "$pkg_src_cmd")"
|
||||
|
||||
# mv monorel ~/.local/opt/monorel-v0.6.5/bin/monorel
|
||||
mv ./monorel "$pkg_src_cmd"
|
||||
}
|
||||
|
||||
pkg_post_install() {
|
||||
b_old_path="${PATH}"
|
||||
export PATH="$HOME/.local/bin:${PATH}"
|
||||
|
||||
if ! command -v git > /dev/null; then
|
||||
"$HOME/.local/bin/webi" git
|
||||
fi
|
||||
|
||||
if ! command -v gh > /dev/null; then
|
||||
"$HOME/.local/bin/webi" gh
|
||||
fi
|
||||
|
||||
if ! command -v goreleaser > /dev/null; then
|
||||
"$HOME/.local/bin/webi" goreleaser
|
||||
fi
|
||||
|
||||
export PATH="${b_old_path}"
|
||||
}
|
||||
|
||||
pkg_get_current_version() {
|
||||
# 'monorel --version' has output in this format:
|
||||
# monorel v0.6.6 ba674a6 (2026-03-08T23:24:03Z)
|
||||
# This trims it down to just the version number:
|
||||
# 0.6.6
|
||||
monorel --version 2> /dev/null |
|
||||
head -n 1 |
|
||||
cut -d' ' -f2 |
|
||||
cut -c 2-
|
||||
}
|
||||
}
|
||||
|
||||
__init_monorel
|
||||
37
monorel/releases.js
Normal file
37
monorel/releases.js
Normal file
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
var github = require('../_common/github.js');
|
||||
var owner = 'therootcompany';
|
||||
var repo = 'golib';
|
||||
|
||||
let Releases = module.exports;
|
||||
|
||||
Releases.latest = async function () {
|
||||
let all = await github(null, owner, repo);
|
||||
|
||||
// This is a monorepo — keep only monorel releases and strip the
|
||||
// path prefix from the version so normalize.js sees plain semver.
|
||||
all.releases = all.releases.filter(function (rel) {
|
||||
return rel.version.startsWith('tools/monorel/');
|
||||
});
|
||||
all.releases.forEach(function (rel) {
|
||||
rel.version = rel.version.replace(/^tools\/monorel\//, '');
|
||||
});
|
||||
|
||||
return all;
|
||||
};
|
||||
|
||||
Releases.sample = async function () {
|
||||
let normalize = require('../_webi/normalize.js');
|
||||
let all = await Releases.latest();
|
||||
all = normalize(all);
|
||||
all.releases = all.releases.slice(0, 5);
|
||||
return all;
|
||||
};
|
||||
|
||||
if (module === require.main) {
|
||||
(async function () {
|
||||
let samples = await Releases.sample();
|
||||
console.info(JSON.stringify(samples, null, 2));
|
||||
})();
|
||||
}
|
||||
@@ -17,13 +17,13 @@ $pkg_src = "$pkg_src_cmd"
|
||||
New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading mutagen from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing mutagen"
|
||||
|
||||
Push-Location .local\tmp
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
$ErrorActionPreference = 'stop'
|
||||
|
||||
function Install-WebiHostedScript () {
|
||||
Param(
|
||||
param(
|
||||
[string]$Package,
|
||||
[string]$ScriptName
|
||||
)
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
$ipv4 = curl.exe -sf https://api.ipify.org
|
||||
|
||||
IF (!($null -eq $ipv4 -or $ipv4 -eq "")) {
|
||||
if (!($null -eq $ipv4 -or $ipv4 -eq "")) {
|
||||
Write-Output "IPv4 (A) : $ipv4"
|
||||
}
|
||||
|
||||
$ipv6 = curl.exe -sf https://api6.ipify.org
|
||||
|
||||
IF (!($null -eq $ipv6 -or $ipv6 -eq "")) {
|
||||
if (!($null -eq $ipv6 -or $ipv6 -eq "")) {
|
||||
Write-Output "IPv6 (AAAA): $ipv6"
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ $my_nerdfont_otf = "Droid Sans Mono for Powerline Nerd Font Complete Windows Com
|
||||
$my_fontdir = "$Env:UserProfile\AppData\Local\Microsoft\Windows\Fonts"
|
||||
|
||||
New-Item -Path "$my_fontdir" -ItemType Directory -Force | Out-Null
|
||||
IF (!(Test-Path -Path "$my_fontdir\$my_nerdfont_otf")) {
|
||||
if (!(Test-Path -Path "$my_fontdir\$my_nerdfont_otf")) {
|
||||
& curl.exe -fsSLo "$my_nerdfont_otf" 'https://github.com/ryanoasis/nerd-fonts/raw/v2.3.3/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete%20Windows%20Compatible.otf'
|
||||
& Move-Item "$my_nerdfont_otf" "$my_fontdir"
|
||||
}
|
||||
|
||||
@@ -63,10 +63,11 @@ To run them manually on your code;
|
||||
- jshintrc (lint)
|
||||
```sh
|
||||
touch .jshintrc .jshintignore
|
||||
jhint -c ./.jshintrc *.js */*.js
|
||||
jshint -c ./.jshintrc *.js */*.js
|
||||
```
|
||||
- fixjson \
|
||||
(turns JavaScript Objects with comments, trailing commas, etc into actual json)
|
||||
(turns JavaScript Objects with comments, trailing commas, etc into actual
|
||||
json)
|
||||
```sh
|
||||
fixjson -i 2 -w ./package.json
|
||||
```
|
||||
@@ -234,7 +235,6 @@ Node app as a Non-System (Unprivileged) Service on Mac, Windows, and Linux:
|
||||
```
|
||||
|
||||
3. Manage the service
|
||||
|
||||
- On macOS
|
||||
|
||||
```sh
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading $Env:PKG_NAME from $Env:WEBI_PKG_URL to $Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
New-Item -Path "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
#Invoke-WebRequest https://nodejs.org/dist/v12.16.2/node-v12.16.2-win-x64.zip -OutFile node-v12.16.2-win-x64.zip
|
||||
@@ -9,7 +9,7 @@ IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
& Move-Item "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE.part" "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION")) {
|
||||
Write-Output "Installing $Env:PKG_NAME"
|
||||
# TODO: temp directory
|
||||
|
||||
|
||||
@@ -21,14 +21,14 @@ $pkg_download_dir = "$Env:USERPROFILE\Downloads\webi\$pkg_cmd_name\$Env:WEBI_VER
|
||||
$pkg_download_file = "$pkg_download_dir\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$pkg_download_file")) {
|
||||
if (!(Test-Path -Path "$pkg_download_file")) {
|
||||
New-Item "$pkg_download_dir" -ItemType Directory -Force | Out-Null
|
||||
Write-Output " Downloading $pkg_cmd_name v$Env:WEBI_VERSION from $Env:WEBI_PKG_URL to $pkg_download_file"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download_file.part"
|
||||
& Move-Item "$pkg_download_file.part" "$pkg_download_file"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output " Installing ollama v$Env:WEBI_VERSION"
|
||||
|
||||
# Remove any leftover tmp cruft, recreate location, push into it
|
||||
|
||||
@@ -18,13 +18,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading ots from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing ots"
|
||||
|
||||
Push-Location .local\tmp
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading pandoc from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing pandoc"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading pathman from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing pathman"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -33,7 +33,7 @@ function mktemp-d-t() {
|
||||
function npm-install-global($pkgname) {
|
||||
# Fetch npm package manager
|
||||
Write-Output "Checking for npm..."
|
||||
if (-Not (command-v-silent("npm"))) {
|
||||
if (-not (command-v-silent("npm"))) {
|
||||
& "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1" node
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
function Repair-MissingCommand {
|
||||
Param(
|
||||
param(
|
||||
[string]$Name,
|
||||
[string]$Package,
|
||||
[string]$Command
|
||||
@@ -9,15 +9,15 @@ function Repair-MissingCommand {
|
||||
|
||||
Write-Host " Checking for $Name ..."
|
||||
$HasCommand = Get-Command -Name $Command -ErrorAction Silent
|
||||
IF ($HasCommand) {
|
||||
Return
|
||||
if ($HasCommand) {
|
||||
return
|
||||
}
|
||||
|
||||
& "$HOME\.local\bin\webi-pwsh.ps1" $Package
|
||||
$null = Sync-EnvPath
|
||||
}
|
||||
|
||||
IF ($null -eq $Env:WEBI_HOST -or "" -eq $Env:WEBI_HOST) {
|
||||
if ($null -eq $Env:WEBI_HOST -or "" -eq $Env:WEBI_HOST) {
|
||||
$Env:WEBI_HOST = "https://webinstall.dev"
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ function Install-PSScriptAnalyzer {
|
||||
Repair-MissingCommand -Name "PowerShell Core" -Package "pwsh" -Command "pwsh"
|
||||
|
||||
$NeedsTrust = pwsh -Command "Get-PSRepository -Name 'PSGallery' | Where-Object -Property InstallationPolicy -eq 'Untrusted'"
|
||||
IF ($NeedsTrust) {
|
||||
if ($NeedsTrust) {
|
||||
Write-Host " Trusting PSRepository 'PSGallery' ..."
|
||||
pwsh -Command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
$PkgName = "pwsh-essentials"
|
||||
|
||||
function Repair-MissingCommand {
|
||||
Param(
|
||||
param(
|
||||
[string]$Name,
|
||||
[string]$Package,
|
||||
[string]$Command
|
||||
@@ -11,8 +11,8 @@ function Repair-MissingCommand {
|
||||
|
||||
Write-Host " Checking for $Name ..."
|
||||
$HasCommand = Get-Command -Name $Command -ErrorAction Silent
|
||||
IF ($HasCommand) {
|
||||
Return
|
||||
if ($HasCommand) {
|
||||
return
|
||||
}
|
||||
|
||||
& "$HOME\.local\bin\webi-pwsh.ps1" $Package
|
||||
@@ -20,7 +20,7 @@ function Repair-MissingCommand {
|
||||
}
|
||||
|
||||
function Install-WebiHostedPSCoreScript () {
|
||||
Param(
|
||||
param(
|
||||
[string]$Package,
|
||||
[string]$ScriptName
|
||||
)
|
||||
|
||||
@@ -22,12 +22,12 @@ function Repair-All($Root) {
|
||||
$Style = $Dim
|
||||
|
||||
$WasDirty = Repair-File -Filepath $Child
|
||||
IF ($WasDirty) {
|
||||
if ($WasDirty) {
|
||||
$WereDirty = $true
|
||||
$Style = $Bold
|
||||
}
|
||||
$RelPath = [System.IO.Path]::GetRelativePath($Root, $Child)
|
||||
IF (Test-Path -PathType Leaf -Path $Root) {
|
||||
if (Test-Path -PathType Leaf -Path $Root) {
|
||||
$RelPath = $Root
|
||||
}
|
||||
Write-Host " ${Style}${RelPath}${ResetWeight}"
|
||||
@@ -37,7 +37,7 @@ function Repair-All($Root) {
|
||||
}
|
||||
|
||||
function Repair-File {
|
||||
Param (
|
||||
param (
|
||||
[string]$Filepath
|
||||
)
|
||||
$WasDirty = $false
|
||||
@@ -48,7 +48,7 @@ function Repair-File {
|
||||
$Fixed = Get-Content -Path $Filepath -Raw
|
||||
$Formatted = Invoke-Formatter -ScriptDefinition $Fixed
|
||||
|
||||
IF ($Original -eq $Formatted) {
|
||||
if ($Original -eq $Formatted) {
|
||||
$WasDirty = $false
|
||||
return $WasDirty
|
||||
}
|
||||
@@ -65,7 +65,7 @@ function Repair-File {
|
||||
|
||||
function Repair-Recursively($Paths) {
|
||||
$Dirty = $false
|
||||
IF ($Paths.Length -lt 1) {
|
||||
if ($Paths.Length -lt 1) {
|
||||
$Paths = , (Get-Location)
|
||||
}
|
||||
|
||||
@@ -73,14 +73,14 @@ function Repair-Recursively($Paths) {
|
||||
Write-Host "Fixing ${Root}"
|
||||
$Entry = Get-Item $Root
|
||||
|
||||
IF (-Not ((Test-Path -PathType Container -Path $Entry) -Or (Test-Path -PathType Leaf -Path $Entry))) {
|
||||
if (-not ((Test-Path -PathType Container -Path $Entry) -or (Test-Path -PathType Leaf -Path $Entry))) {
|
||||
$RelPath = [System.IO.Path]::GetRelativePath($Root, $Entry.FullName)
|
||||
Write-Host " ${Warn}SKIP${ResetColor} ${RelPath} (${Warn}not a regular file or directory${ResetColor})"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$WereDirty = Repair-All $Root $Entry
|
||||
IF ($WereDirty) {
|
||||
if ($WereDirty) {
|
||||
$Dirty = $true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ function Format-All($Root) {
|
||||
$Style = $Dim
|
||||
|
||||
$WasDirty = Format-File -Filepath $Child
|
||||
IF ($WasDirty) {
|
||||
if ($WasDirty) {
|
||||
$WereDirty = $true
|
||||
$Style = $Bold
|
||||
}
|
||||
$RelPath = [System.IO.Path]::GetRelativePath($Root, $Child)
|
||||
IF (Test-Path -PathType Leaf -Path $Root) {
|
||||
if (Test-Path -PathType Leaf -Path $Root) {
|
||||
$RelPath = $Root
|
||||
}
|
||||
Write-Host " ${Style}${RelPath}${ResetWeight}"
|
||||
@@ -37,7 +37,7 @@ function Format-All($Root) {
|
||||
}
|
||||
|
||||
function Format-File {
|
||||
Param (
|
||||
param (
|
||||
[string]$Filepath
|
||||
)
|
||||
$WasDirty = $false
|
||||
@@ -45,7 +45,7 @@ function Format-File {
|
||||
$Original = Get-Content -Path $Filepath -Raw
|
||||
$Formatted = Invoke-Formatter -ScriptDefinition $Original
|
||||
|
||||
IF ($Original -eq $Formatted) {
|
||||
if ($Original -eq $Formatted) {
|
||||
$WasDirty = $false
|
||||
return $WasDirty
|
||||
}
|
||||
@@ -62,7 +62,7 @@ function Format-File {
|
||||
|
||||
function Format-Recursively($Paths) {
|
||||
$Dirty = $false
|
||||
IF ($Paths.Length -lt 1) {
|
||||
if ($Paths.Length -lt 1) {
|
||||
$Paths = , (Get-Location)
|
||||
}
|
||||
|
||||
@@ -70,14 +70,14 @@ function Format-Recursively($Paths) {
|
||||
Write-Host "Formatting ${Root}"
|
||||
$Entry = Get-Item $Root
|
||||
|
||||
IF (-Not ((Test-Path -PathType Container -Path $Entry) -Or (Test-Path -PathType Leaf -Path $Entry))) {
|
||||
if (-not ((Test-Path -PathType Container -Path $Entry) -or (Test-Path -PathType Leaf -Path $Entry))) {
|
||||
$RelPath = [System.IO.Path]::GetRelativePath($Root, $Entry.FullName)
|
||||
Write-Host " ${Warn}SKIP${ResetColor} ${RelPath} (${Warn}not a regular file or directory${ResetColor})"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$WereDirty = Format-All $Root $Entry
|
||||
IF ($WereDirty) {
|
||||
if ($WereDirty) {
|
||||
$Dirty = $true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,16 +23,16 @@ function Debug-All($Root) {
|
||||
|
||||
|
||||
$Diags = Invoke-ScriptAnalyzer -Fix -Path $Child -ExcludeRule PSAvoidUsingWriteHost
|
||||
IF ($Diags.Length -gt 0) {
|
||||
if ($Diags.Length -gt 0) {
|
||||
$AreDirty = $true
|
||||
$Style = $Bold
|
||||
}
|
||||
$RelPath = [System.IO.Path]::GetRelativePath($Root, $Child)
|
||||
IF (Test-Path -PathType Leaf -Path $Root) {
|
||||
if (Test-Path -PathType Leaf -Path $Root) {
|
||||
$RelPath = $Root
|
||||
}
|
||||
Write-Host " ${Style}${RelPath}${ResetWeight}"
|
||||
IF ($Diags.Length -gt 0) {
|
||||
if ($Diags.Length -gt 0) {
|
||||
Write-Host ($Diags | Format-List | Out-String)
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ function Debug-All($Root) {
|
||||
|
||||
function Debug-Recursively($Paths) {
|
||||
$Dirty = $false
|
||||
IF ($Paths.Length -lt 1) {
|
||||
if ($Paths.Length -lt 1) {
|
||||
$Paths = , (Get-Location)
|
||||
}
|
||||
|
||||
@@ -50,14 +50,14 @@ function Debug-Recursively($Paths) {
|
||||
Write-Host "Linting ${Root}"
|
||||
$Entry = Get-Item $Root
|
||||
|
||||
IF (-Not ((Test-Path -PathType Container -Path $Entry) -Or (Test-Path -PathType Leaf -Path $Entry))) {
|
||||
if (-not ((Test-Path -PathType Container -Path $Entry) -or (Test-Path -PathType Leaf -Path $Entry))) {
|
||||
$RelPath = [System.IO.Path]::GetRelativePath($Root, $Entry.FullName)
|
||||
Write-Host " ${Warn}SKIP${ResetColor} ${RelPath} (${Warn}not a regular file or directory${ResetColor})"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$AreDirty = Debug-All $Root $Entry
|
||||
IF ($AreDirty) {
|
||||
if ($AreDirty) {
|
||||
$Dirty = $true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ $pkg_download = "$HOME\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
# Fetch archive
|
||||
Invoke-DownloadURL -URL $Env:WEBI_PKG_URL -Path $pkg_download
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Push-Location "$HOME\.local\tmp"
|
||||
|
||||
# Remove any leftover tmp cruft
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading rclone from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing rclone"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -33,7 +33,7 @@ function mktemp-d-t() {
|
||||
function npm-install-global($pkgname) {
|
||||
# Fetch npm package manager
|
||||
Write-Output "Checking for npm..."
|
||||
if (-Not (command-v-silent("npm"))) {
|
||||
if (-not (command-v-silent("npm"))) {
|
||||
& "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1" node
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading ripgrep from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing ripgrep"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Write-Output "'ripgrep@$Env:WEBI_TAG' is an alias for 'rg@$Env:WEBI_VERSION'"
|
||||
IF ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
|
||||
if ($null -eq $Env:WEBI_HOST -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
|
||||
curl.exe -A MS -fsSL "$Env:WEBI_HOST/rg@$Env:WEBI_VERSION" | powershell
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading runzip from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing runzip"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -20,13 +20,13 @@ $pkg_src = "$pkg_src_dir"
|
||||
New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading sass (dart-sass) from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing sass (dart-sass)"
|
||||
|
||||
Push-Location .local\tmp
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading sclient from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing sclient"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading sd from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing sd"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading serviceman from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing serviceman"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -19,13 +19,13 @@ New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading shellcheck from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing shellcheck"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -17,13 +17,13 @@ $pkg_src = "$pkg_src_cmd"
|
||||
New-Item "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | Out-Null
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE"
|
||||
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE\Downloads\webi\$Env:WEBI_PKG_FILE")) {
|
||||
Write-Output "Downloading shfmt from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& Move-Item "$pkg_download.part" "$pkg_download"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output "Installing shfmt"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
|
||||
@@ -20,14 +20,14 @@ $pkg_download_dir = "$Env:USERPROFILE\Downloads\webi\$pkg_cmd_name\$Env:WEBI_VER
|
||||
$pkg_download_file = "$pkg_download_dir\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$pkg_download_file")) {
|
||||
if (!(Test-Path -Path "$pkg_download_file")) {
|
||||
New-Item "$pkg_download_dir" -ItemType Directory -Force | Out-Null
|
||||
Write-Output " Downloading $pkg_cmd_name v$Env:WEBI_VERSION from $Env:WEBI_PKG_URL to $pkg_download_file"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download_file.part"
|
||||
& Move-Item "$pkg_download_file.part" "$pkg_download_file"
|
||||
}
|
||||
|
||||
IF (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
if (!(Test-Path -Path "$pkg_src_cmd")) {
|
||||
Write-Output " Installing sqlc v$Env:WEBI_VERSION"
|
||||
|
||||
# Remove any leftover tmp cruft and recreate the unpack
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user