2019-11-27 01:24:29 -07:00
|
|
|
# -*- sh -*-
|
|
|
|
|
2017-08-24 19:29:23 -07:00
|
|
|
plugin_list_all_command() {
|
2023-04-11 20:01:32 -07:00
|
|
|
initialize_or_update_plugin_repository
|
2017-08-24 19:29:23 -07:00
|
|
|
|
2018-01-13 23:08:21 -07:00
|
|
|
local plugins_index_path
|
2018-06-10 01:54:39 -07:00
|
|
|
plugins_index_path="$(asdf_data_dir)/repository/plugins"
|
2018-01-13 20:37:48 -07:00
|
|
|
|
2018-01-13 23:08:21 -07:00
|
|
|
local plugins_local_path
|
|
|
|
plugins_local_path="$(get_plugin_path)"
|
|
|
|
|
2021-12-29 10:10:39 -07:00
|
|
|
if find "$plugins_index_path" -mindepth 1 -type d &>/dev/null; then
|
2019-11-30 13:08:52 -07:00
|
|
|
(
|
|
|
|
for index_plugin in "$plugins_index_path"/*; do
|
|
|
|
index_plugin_name=$(basename "$index_plugin")
|
|
|
|
source_url=$(get_plugin_source_url "$index_plugin_name")
|
|
|
|
installed_flag=" "
|
2018-01-13 23:08:21 -07:00
|
|
|
|
2019-11-30 13:08:52 -07:00
|
|
|
[[ -d "${plugins_local_path}/${index_plugin_name}" ]] && installed_flag='*'
|
2018-01-13 23:08:21 -07:00
|
|
|
|
2022-12-23 02:53:22 -07:00
|
|
|
printf "%s\t%s\n" "$index_plugin_name" "$installed_flag$source_url"
|
2019-11-30 13:08:52 -07:00
|
|
|
done
|
2020-06-16 15:26:46 -07:00
|
|
|
) | awk '{ printf("%-28s", $1); sub(/^[^*]/, " &", $2); $1=""; print $0 }'
|
2018-01-13 23:08:21 -07:00
|
|
|
else
|
2022-12-23 02:53:22 -07:00
|
|
|
printf "%s%s\n" "error: index of plugins not found at " "$plugins_index_path"
|
2018-01-13 23:08:21 -07:00
|
|
|
fi
|
2017-08-24 19:29:23 -07:00
|
|
|
}
|
2019-11-27 01:24:29 -07:00
|
|
|
|
|
|
|
plugin_list_all_command "$@"
|