#!/usr/bin/env bash # TODO: Build custom Recursive Code font? set -euo pipefail # shellcheck disable=SC2034 DRY_RUN=0 # TODO # shellcheck disable=SC2034 FORCE=0 # TODO NAME=${0##*/} VERSION="0.1.0" API_URL="https://api.github.com" REPO_OWNER="arrowtype" REPO_NAME="recursive" REPO_PATH="$REPO_OWNER/$REPO_NAME" FONT_DIR="${HOME}/.local/share/fonts/ttf/Recursive" TMPDIR=${TMPDIR:-/tmp} err() { printf "%s\n" "$@" >&2 } err "$NAME v$VERSION" curl() { command curl \ -sSLf \ -H "User-Agent: $NAME/$VERSION" \ "$@" } api() { curl \ -H "Accept: application/vnd.github+json" \ "$@" } jq() { command jq -c "$@" } get_latest_release() { api --get "$API_URL/repos/$REPO_PATH/releases/latest" \ | jq "$(cat < "$FONT_DIR/.VERSION" err "Running fc-cache" fc-cache