#!/usr/bin/env bash set -euo pipefail # shellcheck disable=SC1091 source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh" APP=prometheus VERSION=${VERSION:-2.45.0} APPS_DIR=/usr/local/apps/${APP} URL=https://github.com/prometheus/prometheus/releases/download/v${VERSION}/prometheus-${VERSION}.$(get_os)-$(get_arch).tar.gz extract_tarball "${URL}" "${APPS_DIR}/${VERSION}" "--strip-components 1" sudo set_current_link "${APPS_DIR}" "${VERSION}" sudo apps=$(find ${APPS_DIR}/current/ -maxdepth 1 -executable -type f -exec basename {} \;) cd /usr/local/bin for bin in $apps; do if [[ ! -s $bin ]]; then sudo ln --symbolic \ "$(relative_path "/usr/local/bin" "${APPS_DIR}/current/${bin}")" \ "${bin}" fi done