cunymatthieu / tgenv

Terragrunt version manager
MIT License
223 stars 70 forks source link

Output should go to STDERR #11

Open js-timbirkett opened 4 years ago

js-timbirkett commented 4 years ago

When running terragrunt there are 2 lines:

[INFO] Getting version from tgenv-version-name
[INFO] TGENV_VERSION is 0.23.13

These are sent to STDOUT, this causes issues with terragrunt output and terragrunt graph-dependencies when piped into other tools like jq or dot.

PR incoming.

iainelder commented 3 years ago

@js-timbirkett It seems that this repo is no longer accepting PRs (#19).

There is another implementation of tgenv that avoids this problem by omitting that output.

https://github.com/taosmountain/tgenv

Here's a quick test you can run to check if tgenv is working correctly.

touch terragrunt.hcl
echo 'output "main" { value = "Hello, world!" }' > main.tf

terragrunt init
terragrunt apply --auto-approve

main="$(terragrunt output -raw main)"
echo "${main}"

With this implementation, the output value is mixed up with the debugging info:

$ echo "${main}"
[INFO] Getting version from tgenv-version-name
[INFO] TGENV_VERSION is 0.28.18
Hello, world!

With taosmountain's implementation, it works as you would expect.

$ echo "${main}"
Hello, world!