zshlibs/zbootstrap.zsh

31 lines
811 B
Bash
Raw Normal View History

2021-12-20 14:08:22 +00:00
function zlibs_install()
{
2023-12-15 19:12:34 +00:00
git clone --branch master https://git.brass.host/tea/zshlibs.git "${HOME}/.local/zshlibs"
2022-11-01 13:08:00 +00:00
}
2021-12-20 14:08:22 +00:00
if [[ -z ${zshlibs_install} ]]
2021-11-10 14:41:19 +00:00
then
2021-12-20 14:08:22 +00:00
typeset -g zshlibs_install="${HOME}/.local/zshlibs"
fi
2024-01-18 15:05:39 +00:00
fpath+=(${zshlibs_install}/tools)
2024-04-25 18:16:33 +00:00
autoload zshlibs_update zshlibs_log
2021-12-20 14:08:22 +00:00
if ! [[ -d ${zshlibs_install} ]]
2021-11-10 14:41:19 +00:00
then
2021-12-20 14:08:22 +00:00
zlibs_install
2024-01-18 15:05:39 +00:00
else
2024-04-25 18:16:33 +00:00
zshlibs_log "zbootstrap" "preparing update"
if zmodload -s zsh/sched
then
2024-04-25 18:16:33 +00:00
zshlibs_log "zbootstrap" "updating using sched"
2024-04-25 19:46:14 +00:00
sched +1 zshlibs_update
zshlibs_log "zbootstrap" "scheduled: $(sched)"
else
2024-04-25 18:16:33 +00:00
zshlibs_log "zbootstrap" "sched not available, updating synchroniously"
zshlibs_update
fi
2021-12-20 14:08:22 +00:00
fi
2021-11-10 14:41:19 +00:00
2024-01-18 15:21:01 +00:00
source ${zshlibs_install}/tools.zsh
2024-01-18 15:29:40 +00:00
source ${zshlibs_install}/zconfig.zsh
source ${zshlibs_install}/global.zsh
2024-01-18 12:39:51 +00:00
source ${zshlibs_install}/zssh.zsh