aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-03-10 11:41:53 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-03-10 11:41:53 +0300
commitfd283aa9e5864b36ff5fb6872208efe8bbe32b1a (patch)
tree02dc7832a1d99505ecb2758e5b55c064749b83b8 /internal/p10k.zsh
parentca8ec45f7ac6f1b7437850a5524c85241190bb1c (diff)
comment
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 478ce3bd..643a8ea7 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -2062,6 +2062,8 @@ prompt_package() {
() {
local data field
local -A found
+ # Redneck json parsing. Yields correct results for any well-formed json document.
+ # Produces random garbage for invalid json.
{ data="$(<$file)" || return } 2>/dev/null
data=${data##[[:space:]]#}
[[ $data == '{'* ]] || return