From fea560f2f31dae179cb2110d5479b42ee3265331 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 28 Jul 2023 11:41:14 +0100 Subject: less broken every attribute defaults to "empty", good enough for now --- bos-meta-attribute.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bos-meta-attribute.sh b/bos-meta-attribute.sh index 403414d..9d7a4dd 100644 --- a/bos-meta-attribute.sh +++ b/bos-meta-attribute.sh @@ -106,6 +106,8 @@ function bos/meta/attribute/get-value-into() { array) bos_meta_attribute_result=( "${bos_meta_attribute_store[@]}" ) ;; assoc) bos_meta_attribute_value_expr="$(declare -p "$bos_meta_attribute_store_name")" + # return if there's no value, otherwise the `eval` would fail + [[ "$bos_meta_attribute_value_expr" =~ = ]] || return 0 eval "bos_meta_attribute_result=${bos_meta_attribute_value_expr#*=}" ;; esac -- cgit v1.2.3