Comments (12)
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.
from dasel.
@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.
from dasel.
@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
from dasel.
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.
from dasel.
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 🙂
from 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 map[string]interface{}
.
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.
from dasel.
Thank you @TomWright for looking into this. I very much appreciate it and realize that development of the functionality may not be forthcoming.
from dasel.
It looks like I can import and directly use hcl2json
from my code to make that conversion.
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.
from dasel.
Maybe useful for turning a json byte array to hcl? https://github.com/hashicorp/hcl/blob/main/json/public.go#L20
from dasel.
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
I'm not sure if it's for use with hcl v1 or v2.
from dasel.
That repo is hclv1. Maybe supporting either via a flag works.
from dasel.
By the way, there's a tool like jq just for HCL, but it also only supports v1
(for now): hcql.
from dasel.
Related Issues (20)
- Handle quotes in values HOT 2
- `dasel put --type string` not working when converting to yaml HOT 5
- Delete selector can't find keys with null values HOT 2
- Special characters inside string literals are replaced with Unicode escape sequences in JSON HOT 3
- contains/includes HOT 2
- -w xml is not working when -r is not xml HOT 3
- Support multiple files HOT 1
- CSV file format: Support other characters as separator HOT 2
- Output formatting is not right in some arrays HOT 6
- [BUG] Dasel crash when reading an empty file HOT 5
- Suppress header generation HOT 1
- Is it possible to get a raw value, i.e. without quotes? HOT 3
- Preserve order of keys in JSON lists HOT 1
- How to iterate? HOT 2
- Something is wrong with the new update using the Windows binaries HOT 5
- Crash on Windows 7 x64 HOT 2
- Dasel query crashes with go panic HOT 8
- Supported toml version? HOT 1
- Null value causes incorrect error "property not found" HOT 1
- Empty string becoming null when modifying YAML HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dasel.