1

Context: I would like to create the template of service yaml config and pass corresponding parameter or argument to generate different app config file.

And the problem I got is how to pass the arg value into the dhall file and how to read the arg value from dhall file.

From my understanding, it would be something like dhall-to-yaml --file service.dhall --key test --value "01" but I do not sure how to give the command properly to pass and get the value from it.

1 Answers1

1

dhall-to-yaml accepts an arbitrary Dhall expression on standard input, so if you make your Dhall configuration file a function, like this:

λ(args : { test : Text }) → …

… then you can invoke the configuration file on that argument like this:

$ dhall-to-yaml <<< './config.dhall { test = "01" }'
Gabriella Gonzalez
  • 34,863
  • 3
  • 77
  • 135