better troubleshooting

This commit is contained in:
Mike Farah 2021-12-05 12:15:19 +11:00
parent 7598f73204
commit 3e0da390ee

View File

@ -50,6 +50,9 @@ Use an environment variable with the `strenv` operator to inject the contents fr
LICENSE=$(cat LICENSE) yq eval -n '.a = strenv(LICENSE)'
```
Note that `bash` substitution "$(..)" trims newlines, this will cause string blocks to start with `|-` instead of `|`. If you want to keep your nice trailing newline, read more [here](https://mikefarah.gitbook.io/yq/operators/string-operators#string-blocks-bash-and-newlines)
## Special characters in strings
The `strenv` operator is a great way to handle special characters in strings: