Skip to content

Commit d8647ff

Browse files
committed
antidote lite 0.0.2
1 parent 2d58aae commit d8647ff

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

antidote.lite.zsh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# https://github.com/mattmc3/antidote
55
# license: https://unlicense.org
66
# usage: plugin-load $myplugins
7-
# version: 0.0.1
7+
# version: 0.0.2
88

99
# Set variables.
1010
: ${ANTIDOTE_LITE_HOME:=${XDG_CACHE_HOME:-~/.cache}/antidote.lite}
@@ -14,7 +14,16 @@ typeset -gHa _alite_zopts=(extended_glob glob_dots no_monitor)
1414
function plugin-clone {
1515
emulate -L zsh; setopt local_options $_alite_zopts
1616
local repo plugdir initfile initfiles=()
17-
for repo in ${(u)@}; do
17+
18+
# Remove bare words ${(M)@:#*/*} and paths with leading slash ${@:#/*}.
19+
# Then split/join to keep the 2-part user/repo form to bulk-clone repos.
20+
local -Ua repos
21+
for repo in ${${(M)@:#*/*}:#/*}; do
22+
repo=${(@j:/:)${(@s:/:)repo}[1,2]}
23+
[[ -e $ANTIDOTE_LITE_HOME/$repo ]] || repos+=$repo
24+
done
25+
26+
for repo in $repos; do
1827
plugdir=$ANTIDOTE_LITE_HOME/$repo
1928
initfile=$plugdir/${repo:t}.plugin.zsh
2029
if [[ ! -d $plugdir ]]; then
@@ -40,16 +49,6 @@ function plugin-clone {
4049

4150
##? Load zsh plugins.
4251
function plugin-load {
43-
# Remove bare words ${(M)@:#*/*} and paths with leading slash ${@:#/*}.
44-
# Then split/join to keep the 2-part user/repo form to bulk-clone repos.
45-
local repo; local -Ua repos
46-
for repo in ${${(M)@:#*/*}:#/*}; do
47-
repo=${(@j:/:)${(@s:/:)repo}[1,2]}
48-
[[ -e $ANTIDOTE_LITE_HOME/$repo ]] || repos+=$repo
49-
done
50-
(( $#repos )) && plugin-clone $repos >&2
51-
52-
# script plugins
5352
source <(plugin-script $@)
5453
}
5554

examples/antidote_lite_example.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ myplugins=(
4040

4141
# antidote.lite
4242
source $ZDOTDIR/lib/antidote.lite.zsh
43-
plugin-clone $myrepos
43+
plugin-clone $myrepos $myutils $myprompts $myplugins
4444
plugin-load --kind path $myutils
4545
plugin-load --kind fpath $myprompts
4646
plugin-load $myplugins

0 commit comments

Comments
 (0)