1
0

Compare commits

...

3 Commits

Author SHA1 Message Date
0289d90fb9
zsh: zwc things
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-02-20 09:51:55 +03:00
a54be4863a
dotfiles: remove unreachable code
found by CI
2024-02-20 09:35:47 +03:00
d05065f3aa
ci: introduce 2024-02-20 09:35:34 +03:00
5 changed files with 45 additions and 4 deletions

View File

@ -30,5 +30,3 @@ else
## development tree
gen_gitignore "${path_gitignore}"
fi
exit 1

View File

@ -6,6 +6,7 @@
!/.config/dotfiles/gitignore
!/.config/dotfiles/install.sh
!/.config/dotfiles/scripts/.keep
!/.config/dotfiles/woodpecker.yml
!/.config/htop/htoprc.example
!/.config/mc/ini.example
!/.config/zsh/_.zsh

View File

@ -0,0 +1,34 @@
steps:
- name: check
image: debian:bookworm-slim
environment:
DEBCONF_NONINTERACTIVE_SEEN: "true"
DEBIAN_FRONTEND: noninteractive
DEBIAN_PRIORITY: critical
TERM: linux
MALLOC_ARENA_MAX: "4"
commands:
- |
: # install required packages
apt-get -y update
apt-get -y install file findutils git shellcheck zsh
apt-get -y clean
- |
: # verify that repo doesn't contain "garbage"
find_fast() {
find "$@" -printf . -quit | grep -Fq .
}
if find_fast ./ -type f -name '*.zwc' ; then
echo 'found *.zwc' >&2
find ./ -type f -name '*.zwc'
exit 1
fi
- |
: # try zsh compile
git ls-files | sort -uV | xargs -r file -N -i | grep text/x-shellscript | cut -d: -f1 \
| xargs -r -n1 zsh -efc 'zcompile -UR "$@"' --
find ./ -type f -name '*.zwc' -delete
- |
: # try shellcheck (except for *.zsh)
git ls-files | grep -Fv '.zsh' | sort -uV | xargs -r file -N -i | grep text/x-shellscript | cut -d: -f1 \
| xargs -r -n1 shellcheck

View File

@ -83,6 +83,7 @@ __z_comp_external() {
return 3
fi
fi
zcompile -zUR "$f" || return 4
autoload -Uz "_$c"
return 0
@ -110,8 +111,9 @@ z-comp-invalidate() {
[ -n "$1" ] || return 1
f="${ZSHU[d_cache]}/completion/_$1"
rm -f "$f.zwc"
[ -f "$f" ] || return 2
rm -f "$f" || return 3
rm -f "$f"
}
## reload or new session are required to regenerate completions

View File

@ -14,7 +14,13 @@ dotfiles-git() { (
z-zwc-gen() {
local i
for i ( "${ZSHU[d_conf]}"/**/*.zsh(N.r) ) ; do
zcompile -U "$i"
zcompile -UR "$i"
done
for i ( "${ZSHU[d_cache]}/completion"/*(N.r) ) ; do
case "$i" in
*.zwc ) continue ;;
esac
zcompile -zUR "$i"
done
}