#!/bin/sh # VXO installer: download VXO, check its SHA-256, install it. # curl -fsSL https://vxo.fiftyseven.is/install.sh | sh # Puts VXO.app in /Applications (or ~/Applications) and links the `vxo` # command into ~/.local/bin. Changes nothing else. set -eu VERSION="0.5.0" SHA256="2e3cdb79a37d13450d5d2e43a01f3a41ffa7e29d1de47d8cf7c2fcff07eb54ef" BASE="https://vxo.fiftyseven.is" say() { printf '%s\n' "$*"; } fail() { printf 'vxo install: %s\n' "$*" >&2; exit 1; } [ "$(uname -s)" = "Darwin" ] || fail "VXO is a macOS app." [ "$(uname -m)" = "arm64" ] || fail "this build is for Apple silicon Macs." tmp=$(mktemp -d) trap 'rm -rf "$tmp"' EXIT say "Downloading VXO $VERSION..." curl -fsSL "$BASE/download/VXO-$VERSION.zip" -o "$tmp/VXO.zip" || fail "download failed." got=$(shasum -a 256 "$tmp/VXO.zip" | cut -d' ' -f1) [ "$got" = "$SHA256" ] || fail "checksum mismatch (got $got). Nothing was installed." ditto -x -k "$tmp/VXO.zip" "$tmp/x" || fail "could not unzip." [ -d "$tmp/x/VXO.app" ] || fail "the download has no VXO.app." dest="/Applications" [ -w "$dest" ] || dest="$HOME/Applications" mkdir -p "$dest" if pgrep -qx vxo 2>/dev/null; then say "VXO is running; it keeps the old version until you quit it (Cmd-Q)." fi rm -rf "$dest/VXO.app" ditto "$tmp/x/VXO.app" "$dest/VXO.app" # Downloaded with curl, so macOS has not quarantined it; clear the flag in # case an older copy carried one. The build is not notarized yet. xattr -dr com.apple.quarantine "$dest/VXO.app" 2>/dev/null || true mkdir -p "$HOME/.local/bin" ln -sf "$dest/VXO.app/Contents/MacOS/vxo-cli" "$HOME/.local/bin/vxo" say "Installed $dest/VXO.app and ~/.local/bin/vxo" case ":$PATH:" in *":$HOME/.local/bin:"*) ;; *) say "Add ~/.local/bin to your PATH: echo 'export PATH=\"\$HOME/.local/bin:\$PATH\"' >> ~/.zshrc" ;; esac say "Try: vxo ~/Downloads"