recursiveGetAttrsetWithJqPrefix: fix top level values
Co-authored-by: linyinfeng <lin.yinfeng@outlook.com>
This commit is contained in:
parent
0974f0729a
commit
c4bfbd8926
@ -219,14 +219,14 @@ let
|
|||||||
let
|
let
|
||||||
escapedName = ''"${replaceStrings [ ''"'' "\\" ] [ ''\"'' "\\\\" ] name}"'';
|
escapedName = ''"${replaceStrings [ ''"'' "\\" ] [ ''\"'' "\\\\" ] name}"'';
|
||||||
in
|
in
|
||||||
recurse (prefix + "." + escapedName) item.${name}
|
recurse (prefix + (if prefix == "." then "" else ".") + escapedName) item.${name}
|
||||||
) (attrNames item)
|
) (attrNames item)
|
||||||
else if isList item then
|
else if isList item then
|
||||||
imap0 (index: item: recurse (prefix + "[${toString index}]") item) item
|
imap0 (index: item: recurse (prefix + "[${toString index}]") item) item
|
||||||
else
|
else
|
||||||
[ ];
|
[ ];
|
||||||
in
|
in
|
||||||
listToAttrs (flatten (recurse "" item));
|
listToAttrs (flatten (recurse "." item));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Takes an attrset and a file path and generates a bash snippet that
|
Takes an attrset and a file path and generates a bash snippet that
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user