removed windows and linux split subdir
This commit is contained in:
parent
83dda10fa8
commit
065b982734
280 changed files with 9053 additions and 426 deletions
48
.antidote/functions/antidote-list
Normal file
48
.antidote/functions/antidote-list
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/zsh
|
||||
|
||||
### List cloned bundles.
|
||||
#
|
||||
# usage: antidote list [-h|--help] [-s|--short] [-d|--dirs] [-u|--url]
|
||||
#
|
||||
#function antidote-list {
|
||||
emulate -L zsh; setopt local_options $_adote_funcopts
|
||||
|
||||
local o_help o_short o_url o_dirs
|
||||
zparseopts $_adote_zparopt_flags -- \
|
||||
h=o_help -help=h \
|
||||
s=o_short -short=s \
|
||||
u=o_url -url=u \
|
||||
d=o_dirs -dirs=d ||
|
||||
return 1
|
||||
|
||||
if (( $#o_help )); then
|
||||
antidote-help list
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ $# -ne 0 ]]; then
|
||||
print -ru2 "antidote: error: unexpected $1, try --help"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local bundledir
|
||||
local output=()
|
||||
local bundles=($(antidote-home)/**/.git(/N))
|
||||
|
||||
for bundledir in $bundles; do
|
||||
bundledir=${bundledir:h}
|
||||
local url=$(git -C "$bundledir" config remote.origin.url)
|
||||
if (( $#o_dirs )); then
|
||||
output+=($bundledir)
|
||||
elif (( $#o_url )); then
|
||||
output+=($url)
|
||||
elif (( $#o_short )); then
|
||||
url=${url%.git}
|
||||
url=${url#https://github.com/}
|
||||
output+=($url)
|
||||
else
|
||||
output+=("$(printf '%-64s %s\n' $url $bundledir)")
|
||||
fi
|
||||
done
|
||||
(( $#output )) && printf '%s\n' ${(o)output}
|
||||
#}
|
||||
Loading…
Add table
Add a link
Reference in a new issue