summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2023-07-28 11:41:14 +0100
committerdakkar <dakkar@thenautilus.net>2023-07-28 11:41:14 +0100
commitfea560f2f31dae179cb2110d5479b42ee3265331 (patch)
tree1c005e5bc4cf3d6c6dfafd1f4a8162db480d8e75
parentSTILL BORKEN (diff)
downloadbash-object-system-fea560f2f31dae179cb2110d5479b42ee3265331.tar.gz
bash-object-system-fea560f2f31dae179cb2110d5479b42ee3265331.tar.bz2
bash-object-system-fea560f2f31dae179cb2110d5479b42ee3265331.zip
less broken
every attribute defaults to "empty", good enough for now
-rw-r--r--bos-meta-attribute.sh2
1 files changed, 2 insertions, 0 deletions
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