Created
June 1, 2024 13:01
-
-
Save caseycs/8a1d528b7072d9d7e20bde54b01b27a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# wrapper to format hcl passed via stdin | |
# user for for VSCcode Custom Local Formatters extension (https://marketplace.visualstudio.com/items?itemName=jkillian.custom-local-formatters) | |
# or any other editor relying on stdin/stdout for formatting, like Zed | |
# relevant issues: | |
# * https://github.com/gruntwork-io/terragrunt/issues/1037 | |
# * https://github.com/gruntwork-io/terragrunt/issues/2926 | |
TMPFILE=$(mktemp) | |
cat - > $TMPFILE | |
terragrunt hclfmt --terragrunt-hclfmt-file $TMPFILE | |
cat $TMPFILE | |
rm $TMPFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment