Browse Source

Fix bug when sfpi__key() would not ever return anything

Alois Mahdal 4 years ago
parent
commit
aaa36c1b0a
1 changed files with 11 additions and 8 deletions
  1. 11
    8
      src/include-bash/sfpi.sh

+ 11
- 8
src/include-bash/sfpi.sh View File

@@ -226,14 +226,17 @@ sfpi__key() {
226 226
     local key=$2    # meta-data key
227 227
     local value     # ^^ value
228 228
     local fun="${SFPI__PREFIX}_${plg}__sfpimeta" # plg getter function name
229
-    if type -t "$fun" >/dev/null; then
230
-        value=$("$fun" "$key")
231
-        debug -v fun key value
232
-        test -n "$value" || value="(none)"
233
-    else
234
-        value='(undefined)'
235
-    fi
236
-    echo "$value"
229
+    (
230
+        sfpi__import "$plg"
231
+        if type -t "$fun" >/dev/null; then
232
+            value=$("$fun" "$key")
233
+            debug -v fun key value
234
+            test -n "$value" || value="(none)"
235
+        else
236
+            value='(undefined)'
237
+        fi
238
+        echo "$value"
239
+    )
237 240
 }
238 241
 
239 242
 sfpi__ls_all() {