New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support hcl files #98
Comments
I'm always open to supporting new file formats, as long as they play nicely with other implementations. I will take a look at HCL 2 and get back to you on this soon. Thank you for your interest in dasel 🙂 |
Hey @josegonzalez, This looks like it will be a longer term feature since I'll need to write some logic to parse hcl documents into a generic Short term it looks like you can use a combination of dasel and hcl2json to read hcl documents with dasel. I'll leave this issue open so I can work on it when I have the time. |
@TomWright I've been using hcl2json with jq but hoped that I can use just one. HCL is widely popular in the DevOps world, so, it would great if it's natively supported. |
Thank you @TomWright for looking into this. I very much appreciate it and realize that development of the functionality may not be forthcoming. |
@nikolay I appreciate that and can see the benefit. I'm not saying it's not going to happen, just that I will have to work on it over time rather than a quick change now |
It looks like I can import and directly use This will allow me to add select support relatively easily, but does not (to my knowledge) allow me to convert JSON -> HCL in order for put commands to work. |
Maybe useful for turning a json byte array to hcl? https://github.com/hashicorp/hcl/blob/main/json/public.go#L20 |
That looks promising. I also found this repo although it is a little out of data: https://github.com/kvz/json2hcl/blob/master/main.go |
That repo is hclv1. Maybe supporting either via a flag works. |
Are we interested in HCL v1, v2 or both? To save on mass comment replies here maybe add a 👍 for v1 and a 👎 for v2. |
Thanks for all the feedback here. I am currently reworking the encoding/decoding of all supported formats here: #289 Once that is done I will use have a crack at implementing parsers for HCL V2. |
Is your feature request related to a problem? Please describe.
HCL is a format commonly used for hashicorp tools. It would be great to add direct support for them in dasel.
Describe the solution you'd like
Support HCL v2.
Describe alternatives you've considered
The alternative is not supporting HCL, which is currently the case :)
Additional context
I would like this so that I can add better support for Nomad in the Dokku PaaS.
The text was updated successfully, but these errors were encountered: