$AXZSH/cache/zshrc.cache \
|| return 1
echo "Regenerating cache files ..."
- zsh -ilc '' >/dev/null
+ AXZSH_PLUGIN_CHECK=1 zsh -ilc '' >/dev/null
}
function NormalizedPluginName {
invalid_plugins=()
ax_msg - "Checking plugins ..."
- for dir ($AXZSH/plugins/*(N)); do
+ for dir ($AXZSH/plugins/[a-z0-9]*(N)); do
plugin=${dir:t}
# Test if plugin is already enabled
- [[ -e "$AXZSH/active_plugins/$plugin" ]] \
- && enabled=" (enabled)" \
- || unset enabled
+ if [[ -e "$AXZSH/active_plugins/$plugin" ]]; then
+ printf ' \e[1;32m+\e[m "\e[1m%s\e[m" ... ' "${plugin}"
+ enabled=1
+ else
+ printf ' \e[1;31m-\e[m "%s" ... ' "${plugin}"
+ unset enabled
+ fi
# Test plugin ...
- printf " - \"%s\"%s ... " "$plugin" "$enabled"
new_plugin=""
- for script ($AXZSH/plugins/$plugin/$plugin.{zshrc,zprofile}); do
+ for script ($AXZSH/plugins/$plugin/$plugin.{zshrc,zprofile,ax-io}); do
[[ -r "$script" ]] || continue
AXZSH_PLUGIN_CHECK=1 zsh -i -c "source $script"; r=$?
if [[ $r -eq 0 ]]; then
new_plugin=$plugin
- break
fi
+ break
done
if [[ -n "$new_plugin" ]]; then
detected_plugins+=($new_plugin)
ax_msg 1 "optional."
else
[[ -n "$enabled" ]] && invalid_plugins+=($plugin)
- ax_msg 2 "failed."
+ ax_msg 2 "failed ($r)."
fi
done
echo