Merge pull request #525 from asdf-vm/tb/dont-iterate-over-ls

Address shellcheck warning and use shell globbing instead of ls
This commit is contained in:
Trevor Brown 2019-05-17 21:26:22 -04:00 committed by GitHub
commit 33c292e69d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,8 +64,8 @@ list_installed_versions() {
plugin_installs_path="$(asdf_data_dir)/installs/${plugin_name}"
if [ -d "$plugin_installs_path" ]; then
# shellcheck disable=SC2045
for install in $(ls -d "${plugin_installs_path}"/*/ 2>/dev/null); do
for install in "${plugin_installs_path}"/*/; do
[[ -e "$install" ]] || break
basename "$install" | sed 's/^ref-/ref:/'
done
fi