Skip to content
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

Fix HCL list encoding #27

Merged
merged 1 commit into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

* Incorrect enconding of HCL lists. [#27]

## [1.1.1] - 2020-03-31

### Fixed
Expand Down Expand Up @@ -46,3 +50,4 @@ Initial version with support for managing:
[#19]: https://github.com/rgreinho/tfe-cli/pull/19
[#20]: https://github.com/rgreinho/tfe-cli/pull/20
[#23]: https://github.com/rgreinho/tfe-cli/pull/23
[#27]: https://github.com/rgreinho/tfe-cli/pull/27
2 changes: 1 addition & 1 deletion cmd/variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var variableCreateCmd = &cobra.Command{
for i := 0; i < value.Len(); i++ {
b[i] = fmt.Sprintf("%s", value.Index(i))
}
HCLVarFile = append(HCLVarFile, fmt.Sprintf("%s=[%s]", k, strings.Join(b, ", ")))
HCLVarFile = append(HCLVarFile, fmt.Sprintf("%s=[\"%s\"]", k, strings.Join(b, "\", \"")))
} else {
// Otherwise it is always a regular variable.
regularVarFile = append(regularVarFile, fmt.Sprintf("%s=%s", k, strct.Interface()))
Expand Down