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
|
||||
|
||||
APP=starship
|
||||
VERSION=${VERSION:-v0.47.0}
|
||||
DATA_DIR="${XDG_DATA_HOME}/apps/releases"
|
||||
DEST_DIR="${DATA_DIR}/${APP}/${VERSION}"
|
||||
source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh"
|
||||
|
||||
OS=
|
||||
ARCH=
|
||||
function get_os () {
|
||||
case $(uname -s) in
|
||||
Linux*) OS=unknown-linux-gnu;;
|
||||
Darwin*) OS=apple-darwin;;
|
||||
*) >&2 echo "unsupported os"; return;
|
||||
Linux*) echo unknown-linux-gnu;;
|
||||
Darwin*) echo apple-darwin;;
|
||||
*) >&2 echo "unsupported os: $(uname -s)"; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
function get_arch () {
|
||||
case $(uname -m) in
|
||||
x86_64*) ARCH=x86_64;;
|
||||
x86_64*) echo x86_64;;
|
||||
*) >&2 echo "unsupported architecture: $(uname -m)"; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
URL="https://github.com/starship/starship/releases/download/${VERSION}/starship-${ARCH}-${OS}.tar.gz"
|
||||
TMP_DIR=
|
||||
if [[ ! -d "${DEST_DIR}" ]] ; then
|
||||
TMP_DIR=$(mktemp --directory)
|
||||
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
|
||||
APP=starship
|
||||
VERSION=${VERSION:-0.54.0}
|
||||
DEST="${XDG_DATA_HOME}/apps/releases/${APP}"
|
||||
URL="https://github.com/starship/starship/releases/download/v${VERSION}/starship-$(get_arch)-$(get_os).tar.gz"
|
||||
|
||||
cd "${DATA_DIR}/${APP}" || exit
|
||||
[[ -s current ]] && unlink current
|
||||
ln -s "${VERSION}" current
|
||||
extract_tarball "${URL}" "${DEST}/${VERSION}"
|
||||
set_current_link "${DEST}" "${VERSION}"
|
||||
|
||||
cd "${XDG_BIN_HOME}" || exit
|
||||
[[ -L "${APP}" ]] || ln --symbolic "${DATA_DIR}/${APP}/current/${APP}" ${APP}
|
||||
cd "$XDG_BIN_HOME" || exit 1
|
||||
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