Update starship for version 0.54
parent
c5092e5fa9
commit
e2a852d903
@ -1 +1,2 @@
|
|||||||
eval "$(starship init bash)"
|
# vim: ft=bash
|
||||||
|
source <(starship init bash)
|
||||||
|
@ -1 +1,2 @@
|
|||||||
eval "$(starship init zsh)"
|
# vim: ft=zsh
|
||||||
|
source <(starship init zsh)
|
||||||
|
@ -1,37 +1,31 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
APP=starship
|
source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh"
|
||||||
VERSION=${VERSION:-v0.47.0}
|
|
||||||
DATA_DIR="${XDG_DATA_HOME}/apps/releases"
|
|
||||||
DEST_DIR="${DATA_DIR}/${APP}/${VERSION}"
|
|
||||||
|
|
||||||
OS=
|
function get_os () {
|
||||||
ARCH=
|
|
||||||
case $(uname -s) in
|
case $(uname -s) in
|
||||||
Linux*) OS=unknown-linux-gnu;;
|
Linux*) echo unknown-linux-gnu;;
|
||||||
Darwin*) OS=apple-darwin;;
|
Darwin*) echo apple-darwin;;
|
||||||
*) >&2 echo "unsupported os"; return;
|
*) >&2 echo "unsupported os: $(uname -s)"; exit 1;;
|
||||||
esac
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_arch () {
|
||||||
case $(uname -m) in
|
case $(uname -m) in
|
||||||
x86_64*) ARCH=x86_64;;
|
x86_64*) echo x86_64;;
|
||||||
*) >&2 echo "unsupported architecture: $(uname -m)"; exit 1;;
|
*) >&2 echo "unsupported architecture: $(uname -m)"; exit 1;;
|
||||||
esac
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
URL="https://github.com/starship/starship/releases/download/${VERSION}/starship-${ARCH}-${OS}.tar.gz"
|
APP=starship
|
||||||
TMP_DIR=
|
VERSION=${VERSION:-0.54.0}
|
||||||
if [[ ! -d "${DEST_DIR}" ]] ; then
|
DEST="${XDG_DATA_HOME}/apps/releases/${APP}"
|
||||||
TMP_DIR=$(mktemp --directory)
|
URL="https://github.com/starship/starship/releases/download/v${VERSION}/starship-$(get_arch)-$(get_os).tar.gz"
|
||||||
TAR_GZ="${TMP_DIR}/release.tar.gz"
|
|
||||||
curl --location --silent --output "${TAR_GZ}" "${URL}"
|
|
||||||
mkdir -p "${DEST_DIR}"
|
|
||||||
tar xzf "${TAR_GZ}" --directory "${DEST_DIR}"
|
|
||||||
rm -rf "${TMP_DIR}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd "${DATA_DIR}/${APP}" || exit
|
extract_tarball "${URL}" "${DEST}/${VERSION}"
|
||||||
[[ -s current ]] && unlink current
|
set_current_link "${DEST}" "${VERSION}"
|
||||||
ln -s "${VERSION}" current
|
|
||||||
|
|
||||||
cd "${XDG_BIN_HOME}" || exit
|
cd "$XDG_BIN_HOME" || exit 1
|
||||||
[[ -L "${APP}" ]] || ln --symbolic "${DATA_DIR}/${APP}/current/${APP}" ${APP}
|
unlink_if_set "$XDG_BIN_HOME/${APP}"
|
||||||
|
ln -s "$(relative_path "${XDG_BIN_HOME}" "${DEST}/current/${APP}")" ${APP}
|
||||||
|
cd - >/dev/null || exit 1
|
||||||
|
Loading…
Reference in New Issue