hclq icon indicating copy to clipboard operation
hclq copied to clipboard

[Bug] missing quote in get with raw flag

Open caongocthai opened this issue 4 years ago • 0 comments

Create simple hcl file example.tf:

data "foo" {
  "bar" = "        - \"one\"\n        - \"-two\"\n        - \"three\""
}

Run: cat example.tf | hclq get --raw 'data.foo.bar'

Expect:

        - "one"
        - "-two"
        - "three"

Get:

        - "one"
        - "-two"
        - "three    <- missing the last double quote here 

This 2 scenarios would work fine without problem:

data "foo" {
  "bar" = "        - \"one\"\n        - \"-two\"\n        - \"three\"\n"  <- add a new line \n at the end here
}

or

data "foo" {
  "bar" = "        - 'one'\n        - '-two'\n        - 'three'"  <- use single quote ' instead of escape double quotes \"
}

caongocthai avatar Oct 24 '19 10:10 caongocthai