fix: broken symbolic link after creinstall .

Signed-off-by: Miles Liu <miles@bung.cc>
This commit is contained in:
Miles Liu 2023-01-07 11:15:54 +08:00
parent f214ebe485
commit da0d6b712c
No known key found for this signature in database
GPG key ID: 4DB9B32F9B24A7A9
2 changed files with 7 additions and 1 deletions

View file

@ -37,6 +37,12 @@
local vim="$ZBIN/vim"; assert $vim is_executable
$vim --version; assert $state equals 0
}
@test 'zsh-completions' {
run zinit light-mode for zsh-users/zsh-completions
zinit cd zsh-users/zsh-completions
run zinit creinstall -q .; assert $state equals 0
local broken_completions=($(echo "$ZINIT[COMPLETIONS_DIR]"/*(-@))); assert "${#broken_completions[@]}" equals 0
}
# @test 'zsh_bin' {
# run zinit as'null' sbin'bin/zsh' for @romkatv/zsh-bin
# assert $state equals 0

View file

@ -563,7 +563,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
# Symlink completions if they are not already there
# either as completions (_fname) or as backups (fname)
# OR - if its a reinstall
for c in "${completions[@]}"; do
for c in "${completions[@]:A}"; do
cfile="${c:t}"
bkpfile="${cfile#_}"
if [[ ( -z ${already_symlinked[(r)*/$cfile]} || $reinstall = 1 ) &&