#!/usr/bin/env bash # shellcheck disable=SC1090 source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh" APP=traefik VERSION=${VERSION:-3.0.1} DEST="${XDG_DATA_HOME}/apps/releases/${APP}" URL=https://github.com/traefik/traefik/releases/download/v${VERSION}/traefik_v${VERSION}_$(get_os)_$(get_arch).tar.gz extract_tarball "${URL}" "${DEST}/${VERSION}" set_current_link "${DEST}" "${VERSION}" if [[ -L "$XDG_BIN_HOME/${APP}" ]]; then unlink "$XDG_BIN_HOME/${APP}" fi cd "$XDG_BIN_HOME" || exit 1 REL_LINK="$(relative_path "${XDG_BIN_HOME}" "${DEST}/current/${APP}")" ln -s "${REL_LINK}" ${APP}