zsh: tweak zinit installation - dotfiles - 🍚 personal arsenal of "rice"
HTML git clone https://git.drkhsh.at/dotfiles.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit 193aa7a0dff17e2354a8001ca7f5ce2cd1ec7907
DIR parent ad9cd215e2ecd4ae65a93feae9152d6219a9beb4
HTML Author: drkhsh <me@drkhsh.at>
Date: Tue, 10 Sep 2024 00:50:48 +0200
zsh: tweak zinit installation
Diffstat:
M zsh/.config/zsh/00-zinit.zsh | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
DIR diff --git a/zsh/.config/zsh/00-zinit.zsh b/zsh/.config/zsh/00-zinit.zsh
@@ -1,6 +1,13 @@
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
-[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
-[ ! -d $ZINIT_HOME/.git ] && git clone --single-branch --depth=1 https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
+if [ ! -d "$ZINIT_HOME" ]; then
+ print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
+ command mkdir -p "$(dirname $ZINIT_HOME)" && command chmod g-rwX "$ZINIT_HOME"
+ [ ! -d "$ZINIT_HOME"/.git ] && \
+ command git clone --single-branch --depth=1 https://github.com/zdharma-continuum/zinit "$ZINIT_HOME" && \
+ zcompile "${ZINIT_HOME}/zinit.zsh" && \
+ print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
+ print -P "%F{160}▓▒░ The clone has failed.%f%b"
+fi
source "${ZINIT_HOME}/zinit.zsh"
# zsh-banner