From 3c8d8ca5e1ff80c78af743d07dfac373db7d2a25 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sun, 8 May 2022 16:01:23 -0700 Subject: [PATCH] Starship support. --- bin/install_tool | 8 ++++++++ dotfiles/zshrc.d/functions.zsh | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/bin/install_tool b/bin/install_tool index 2d55b35..0ef81cc 100755 --- a/bin/install_tool +++ b/bin/install_tool @@ -433,6 +433,14 @@ EOF kubeconform) go install github.com/yannh/kubeconform/cmd/kubeconform@latest ;; + starship) + mkdir -p ${DESTDIR} + download \ + "https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-musl.tar.gz" \ + /tmp/starship.tar.gz + tar -C ${DESTDIR} -zxf /tmp/starship.tar.gz starship + add_bin_symlink starship + ;; *) echo "Unknown tool: ${TOOL}" >/dev/stderr list_tools diff --git a/dotfiles/zshrc.d/functions.zsh b/dotfiles/zshrc.d/functions.zsh index 587d3b2..c440738 100644 --- a/dotfiles/zshrc.d/functions.zsh +++ b/dotfiles/zshrc.d/functions.zsh @@ -1,3 +1,9 @@ function dumpenv { tr '\0' '\n' < /proc/${1}/environ } + +if test -x "${HOME}/tools/starship/starship" ; then + function starship_prompt { + eval $($HOME/tools/starship/starship init zsh) + } +fi