aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-02-08 19:00:31 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-02-08 19:00:31 +0300
commit540f8956692f34ff51e05664b5c768ce5f4c0e31 (patch)
tree50f6dca9e3f6304cc352d30cbd1e057224e373be
parent160fb52f47c07ee77489c15b41b9e57e5926ebee (diff)
bug fix: handle empty versions in legacy asdf files correctly
-rw-r--r--internal/p10k.zsh7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 2e41ba81..86718bf5 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4614,19 +4614,18 @@ function _p9k_asdf_parse_version_file() {
if (( is_legacy )); then
local plugin has_parse
for plugin has_parse in $=_p9k_asdf_file_info[$file:t]; do
- (( $+versions[$plugin] )) && continue
local cached=$_p9k_asdf_file2versions[$plugin:$file]
if [[ $cached == $stat[1]:* ]]; then
- versions[$plugin]=${cached#*:}
+ local v=${cached#*:}
else
if (( has_parse )); then
local v=($(${ASDF_DATA_DIR:-~/.asdf}/plugins/$plugin/bin/parse-legacy-file $file 2>/dev/null))
else
{ local v=($(<$file)) } 2>/dev/null
fi
- (( $#v )) && versions[$plugin]="$v"
_p9k_asdf_file2versions[$plugin:$file]=$stat[1]:"$v"
fi
+ (( $#v )) && : ${versions[$plugin]="$v"}
done
else
local cached=$_p9k_asdf_file2versions[:$file]
@@ -4645,7 +4644,7 @@ function _p9k_asdf_parse_version_file() {
fi
local plugin version
for plugin version in $file_versions; do
- (( $+versions[$plugin] )) || versions[$plugin]=$version
+ : ${versions[$plugin]=$version}
done
fi
return 0