Unverified Commit 319663db authored by Lin Jian's avatar Lin Jian Committed by GitHub
Browse files

recursiveGetAttrsetWithJqPrefix: fix top level values (#434171)

parents f9070014 c4bfbd89
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -219,14 +219,14 @@ let
              let
                escapedName = ''"${replaceStrings [ ''"'' "\\" ] [ ''\"'' "\\\\" ] name}"'';
              in
              recurse (prefix + "." + escapedName) item.${name}
              recurse (prefix + (if prefix == "." then "" else ".") + escapedName) item.${name}
            ) (attrNames item)
          else if isList item then
            imap0 (index: item: recurse (prefix + "[${toString index}]") item) item
          else
            [ ];
      in
      listToAttrs (flatten (recurse "" item));
      listToAttrs (flatten (recurse "." item));

    /*
      Takes an attrset and a file path and generates a bash snippet that