1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-13 16:40:08 +00:00
This commit is contained in:
romkatv 2020-03-10 09:41:53 +01:00
parent ca8ec45f7a
commit fd283aa9e5

View file

@ -2062,6 +2062,8 @@ prompt_package() {
() { () {
local data field local data field
local -A found 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="$(<$file)" || return } 2>/dev/null
data=${data##[[:space:]]#} data=${data##[[:space:]]#}
[[ $data == '{'* ]] || return [[ $data == '{'* ]] || return