6ca4690edc
Fix computing the list of unused modules by using the full `_zdirs` instead of just the `_zmodules` names. The fixed code was even simpler and cleaner, which makes it even more satisfying. :- ) Show "not found" instead of "not installed" error when an external module dir does not exist, since we don't install external modules.
20 lines
605 B
Plaintext
20 lines
605 B
Plaintext
_zimfw_list_unuseds() {
|
|
local -i i=1
|
|
local -a zinstalled=(${ZIM_HOME}/modules/*(N/))
|
|
# Search into subdirectories
|
|
while (( i <= ${#zinstalled} )); do
|
|
if (( ${_zdirs[(I)${zinstalled[i]}/*]} || ${_zdisabled_dirs[(I)${zinstalled[i]}/*]} )); then
|
|
zinstalled+=(${zinstalled[i]}/*(N/))
|
|
zinstalled[i]=()
|
|
else
|
|
(( i++ ))
|
|
fi
|
|
done
|
|
# Unused = all installed dirs not in _zdirs and _zdisabled_dirs
|
|
_zunused_dirs=(${${zinstalled:|_zdirs}:|_zdisabled_dirs})
|
|
local zunused
|
|
for zunused in ${_zunused_dirs}; do
|
|
_zimfw_print -PR "%B${zunused:t}:%b ${zunused}${1}"
|
|
done
|
|
}
|