2
0
Fork 0
mirror of https://github.com/bazel-contrib/bazel-lib synced 2024-11-28 21:33:48 +00:00
bazel-lib/lib/private/parse_status_file.jq
2022-08-22 12:39:54 -07:00

6 lines
335 B
Plaintext

[
split("\n")[] # Convert lines to array
| capture("(?<key>[^\\s]+)\\s+(?<value>.*)"; "x") # capture {"key": [everything before first whitespace], "value": [remainder of line]}
]
| from_entries # Convert [{"key": "a", "value": "b"}] to map {"a": "b"}