#!/usr/bin/env bash set -euo pipefail version="v0.10.0" sha256="0d1633b71e44081c6a3ca57ad5be3df7a9563698827638838939c3c832e87351" install_dir="${1:-${LORE_INSTALL_DIR:-${HOME}/.local/bin}}" if [[ "$(uname -s)" != Linux || "$(uname -m)" != x86_64 ]]; then echo "error: this installer currently supports Linux x86_64 only" >&2 exit 1 fi mkdir -p "$install_dir" tmp_dir="$(mktemp -d)" trap 'rm -rf "$tmp_dir"' EXIT archive="lore-${version}-x86_64-unknown-linux-gnu.tar.gz" url="https://github.com/EpicGames/lore/releases/download/${version}/${archive}" curl --fail --location --silent --show-error --output "$tmp_dir/$archive" "$url" printf '%s %s\n' "$sha256" "$tmp_dir/$archive" | sha256sum --check --status tar --extract --gzip --file "$tmp_dir/$archive" --directory "$tmp_dir" binary="$(find "$tmp_dir" -type f -name lore -print -quit)" if [[ -z "$binary" ]]; then echo "error: Lore archive did not contain a lore binary" >&2 exit 1 fi install -m 0755 "$binary" "$install_dir/lore" "$install_dir/lore" --version