Update starship for version 0.54

main
Buddy Sandidge 4 years ago
parent c5092e5fa9
commit e2a852d903

@ -74,6 +74,9 @@ extract_zip () {
dest="${2}" dest="${2}"
args="${3}" args="${3}"
sudo="${4}" sudo="${4}"
if [ -d "${dest}" ]; then
return
fi
mkdir_if_missing "${dest}" "${sudo}" mkdir_if_missing "${dest}" "${sudo}"
tmp_dir="$(mktemp -d)" tmp_dir="$(mktemp -d)"
@ -89,6 +92,9 @@ extract_tarball () {
dest="${2}" dest="${2}"
args="${3}" args="${3}"
sudo="${4}" sudo="${4}"
if [ -d "${dest}" ]; then
return
fi
mkdir_if_missing "${dest}" "${sudo}" mkdir_if_missing "${dest}" "${sudo}"
tmp_dir="$(mktemp -d)" tmp_dir="$(mktemp -d)"

@ -1 +1,2 @@
eval "$(starship init bash)" # vim: ft=bash
source <(starship init bash)

@ -13,7 +13,6 @@ format = """\
""" """
[username] [username]
style = "green"
style_user = "green" style_user = "green"
format = "[$user]($style) " format = "[$user]($style) "
@ -51,5 +50,4 @@ format = "[$duration]($style) "
[character] [character]
success_symbol = "λ" success_symbol = "λ"
style_success = ""
error_symbol = "[☠](red)" error_symbol = "[☠](red)"

@ -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*) echo unknown-linux-gnu;;
Linux*) OS=unknown-linux-gnu;; Darwin*) echo apple-darwin;;
Darwin*) OS=apple-darwin;; *) >&2 echo "unsupported os: $(uname -s)"; exit 1;;
*) >&2 echo "unsupported os"; return; esac
esac }
case $(uname -m) in function get_arch () {
x86_64*) ARCH=x86_64;; case $(uname -m) in
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…
Cancel
Save