Skip to content

Commit

Permalink
Correct indentation in command-help.bash
Browse files Browse the repository at this point in the history
  • Loading branch information
Stratus3D committed Jul 9, 2020
1 parent 3c48d6d commit a774850
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions lib/commands/command-help.bash
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ asdf_extension_cmds() {
# shellcheck disable=SC2012
ext_cmds="$(ls -1 "$plugins_path"/*/lib/commands/command*.bash 2>/dev/null |
sed "s#^$plugins_path/##;s#lib/commands/command##;s/.bash//;s/^-//;s/-/ /g")"
if test -n "$ext_cmds"; then
echo "$ext_cmds" | cut -d'/' -f 1 | uniq | while read -r plugin; do
echo
echo "PLUGIN $plugin"
echo "$ext_cmds" | grep "$plugin/" | sed "s#^$plugin/# asdf $plugin#" | sort
done
fi
}
if test -n "$ext_cmds"; then
echo "$ext_cmds" | cut -d'/' -f 1 | uniq | while read -r plugin; do
echo
echo "PLUGIN $plugin"
echo "$ext_cmds" | grep "$plugin/" | sed "s#^$plugin/# asdf $plugin#" | sort
done
fi
}

help_command() {
local plugin_name="$1"
local tool_version="$2"
local plugin_path
help_command() {
local plugin_name="$1"
local tool_version="$2"
local plugin_path

# If plugin name is present as first argument output plugin help info
if [ -n "$plugin_name" ]; then
Expand All @@ -54,7 +54,6 @@ asdf_extension_cmds() {
if [ "${version_info[0]}" = "latest" ]; then
local version
version=$(asdf latest "$plugin_name" "${version_info[1]}")
full_version=$version
else
local version="${version_info[0]}"
fi
Expand All @@ -64,16 +63,16 @@ asdf_extension_cmds() {
install_path=$(get_install_path "$plugin_name" "$install_type" "$version")

(
# shellcheck disable=SC2031
export ASDF_INSTALL_TYPE=$install_type
# shellcheck disable=SC2031
export ASDF_INSTALL_VERSION=$version
# shellcheck disable=SC2031
export ASDF_INSTALL_PATH=$install_path
bash "${plugin_path}"/bin/documentation
)
else
(bash "${plugin_path}"/bin/documentation)
# shellcheck disable=SC2031
export ASDF_INSTALL_TYPE=$install_type
# shellcheck disable=SC2031
export ASDF_INSTALL_VERSION=$version
# shellcheck disable=SC2031
export ASDF_INSTALL_PATH=$install_path
bash "${plugin_path}"/bin/documentation
)
else
(bash "${plugin_path}"/bin/documentation)
fi
else
echo "No documentation for plugin $plugin_name" >&2
Expand Down

0 comments on commit a774850

Please sign in to comment.