From 24507b9744708a8922a7d3014e2a69593fa53af7 Mon Sep 17 00:00:00 2001
From: romkatv <roman.perepelitsa@gmail.com>
Date: Thu, 13 Feb 2020 20:44:59 +0100
Subject: asdf bug fix: call list-legacy-filenames only when
 legacy_version_file = yes

Fixes #492.
---
 internal/p10k.zsh | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

(limited to 'internal')

diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index c97291d1..d0a5637a 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4588,21 +4588,20 @@ function _p9k_asdf_init_meta() {
       local plugin
       for plugin in $root/[^[:space:]]##(N); do
         _p9k_asdf_plugins+=${plugin:t}
+        (( legacy_enabled )) || continue
         if [[ ! -e $plugin/bin ]]; then
           files+=$plugin/bin
         else
           local list_names=$plugin/bin/list-legacy-filenames
           files+=$list_names
           if [[ -x $list_names ]]; then
+            local parse=$plugin/bin/parse-legacy-file
             local -i has_parse=0
-            if (( legacy_enabled )); then
-              local parse=$plugin/bin/parse-legacy-file
-              files+=$parse
-              [[ -x $parse ]] && has_parse=1
-            fi
+            files+=$parse
+            [[ -x $parse ]] && has_parse=1
             local name
             for name in $($list_names 2>/dev/null); do
-              [[ $name == (*/*|*:*|.tool-versions) ]] && continue
+              [[ $name == (*/*|.tool-versions) ]] && continue
               _p9k_asdf_file_info[$name]+="${plugin:t} $has_parse "
             done
           fi
-- 
cgit v1.2.3