Closed zackse closed 5 years ago
@zackse thank you so much for contributing, this looks great 👍
Would you mind writing a test covering this case?
Hi @nathanielks, I committed a simple test case for lib/template.js
-- let me know if this is sufficient or if you had something more exhaustive in mind.
Thanks for publishing this project!
CloudFormation templates accept a "loose" JSON structure where trailing commas in lists/objects are allowed, but this fails when processing the source content with JSON.parse:
This crude hack attempts to strip trailing commas before passing the template body to JSON.parse.
If you are using @nathanielks 's scripts from https://gist.github.com/nathanielks/9282d59ab065f8ee0e373ca7199df085, the error would manifest as:
when the (error) output from cf-to-tf is passed to jq at https://gist.github.com/nathanielks/9282d59ab065f8ee0e373ca7199df085#file-import-stack-sh-L52
Hope this helps anyone else who runs into this.