|
|
|
@ -5,28 +5,9 @@ source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh"
|
|
|
|
|
|
|
|
|
|
APP=direnv
|
|
|
|
|
VERSION=${VERSION:-2.28.0}
|
|
|
|
|
DATA_DIR="${XDG_DATA_HOME}/apps/releases"
|
|
|
|
|
DEST_DIR="${DATA_DIR}/${APP}/${VERSION}"
|
|
|
|
|
DEST="${XDG_DATA_HOME}/apps/releases/${APP}"
|
|
|
|
|
URL=https://github.com/direnv/direnv/releases/download/v${VERSION}/direnv.$(get_os)-$(get_arch)
|
|
|
|
|
|
|
|
|
|
if [[ ! -d "${DEST_DIR}" ]] ; then
|
|
|
|
|
TMP_DIR=$(mktemp -d)
|
|
|
|
|
OUTPUT="${TMP_DIR}/${APP}"
|
|
|
|
|
curl --location --silent --output "${OUTPUT}" "${URL}"
|
|
|
|
|
mkdir -p "${DEST_DIR}"
|
|
|
|
|
chmod 755 "${OUTPUT}"
|
|
|
|
|
mv -v "${OUTPUT}" "${DEST_DIR}/${APP}"
|
|
|
|
|
rm -rf "${TMP_DIR}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cd "${DATA_DIR}/${APP}" || exit 1
|
|
|
|
|
[[ -s current ]] && unlink current
|
|
|
|
|
ln -s "${VERSION}" current
|
|
|
|
|
|
|
|
|
|
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}" "${DATA_DIR}/${APP}/current/${APP}")"
|
|
|
|
|
[[ -L "${APP}" ]] || ln -s "${REL_LINK}" "${APP}"
|
|
|
|
|
extract_tarball "${URL}" "${DEST}/${VERSION}"
|
|
|
|
|
set_current_link "${DEST}" "${VERSION}"
|
|
|
|
|
set_link "${XDG_BIN_HOME}/${APP}" "${DEST}" "${APP}"
|
|
|
|
|