diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2024-05-11 15:20:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-11 19:20:45 +0000 |
| commit | 916ebe6ea6d0319a37f0c4b62fd5e4a189f3dc50 (patch) | |
| tree | 89422b20e758e8ccf5c35cf6cd1f36f759532362 /docs | |
| parent | a55441b886ee692f8734e6c561ae0ebebff64a55 (diff) | |
feat!: Always suppress empty output (#1981)
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/content/config.md | 10 | ||||
| -rw-r--r-- | docs/content/usage.md | 10 |
2 files changed, 2 insertions, 18 deletions
diff --git a/docs/content/config.md b/docs/content/config.md index a260c2d2..a0eaf485 100644 --- a/docs/content/config.md +++ b/docs/content/config.md @@ -447,16 +447,6 @@ Overrides the right template delimiter. rightDelim: '))' ``` -## `suppressEmpty` - -See _[Suppressing empty output](../usage/#suppressing-empty-output)_ - -Suppresses empty output (i.e. output consisting of only whitespace). Can also be set with the `GOMPLATE_SUPPRESS_EMPTY` environment variable. - -```yaml -suppressEmpty: true -``` - ## `templates` See [`--template`/`-t`](../usage/#template-t). diff --git a/docs/content/usage.md b/docs/content/usage.md index 1ac2ca96..3d390978 100644 --- a/docs/content/usage.md +++ b/docs/content/usage.md @@ -424,16 +424,10 @@ hello world See also [`--exec-pipe`](#exec-pipe) for piping output directly into the post-exec command. -## Suppressing empty output +## Empty output -Sometimes it can be desirable to suppress empty output (i.e. output consisting of only whitespace). To do so, set `suppressEmpty: true` in your [config](../config/#suppressempty) file, or `GOMPLATE_SUPPRESS_EMPTY=true` in your environment: +If the template renders to an empty file (i.e. output consisting of only whitespace), gomplate will not write the output. -```console -$ export GOMPLATE_SUPPRESS_EMPTY=true -$ gomplate -i '{{ print " \n" }}' -o out -$ cat out -cat: out: No such file or directory -``` [default context]: ../syntax/#the-context [context]: ../syntax/#the-context |
