Skip to content

[Bug] missing quote in get with raw flag #21

Description

@caongocthai

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 \"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions