Skip to content
Discussion options

You must be logged in to vote

Hi @kimfy - welcome to the CUE project.

Great question. Here is an example of what I think you're after:

exec cue export --with-context -l '_inputs:' -l filename input1.json input2.json input3.json input4.json input5.json x.cue
cmp stdout stdout.golden

-- input1.json --
{ "oof": "test1" }
-- input2.json --
{ "oof": "test2" }
-- input3.json --
{ "oof": "test3" }
-- input4.json --
{ "oof": "test4" }
-- input5.json --
{ "oof": "test5" }
-- x.cue --
package x

#Foo: {
	oof?: string
	rab?: string
}

_inputs: [string]: #Foo
foos: [
	for _, v in _inputs {v},
]
-- stdout.golden --
{
    "foos": [
        {
            "oof": "test1"
        },
        {
            "oof": "test2"
        },
    …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kimfy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants