summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSong Li <45057405+lliissoonngg@users.noreply.github.com>2024-02-05 20:36:18 -0500
committerGitHub <noreply@github.com>2024-02-06 01:36:18 +0000
commit4d24b9d1eb9b9020107c083a55ffa2de97740d22 (patch)
tree323423d05216a8facccee3b245b8eba7fc5cb0a3 /docs
parent24879386331ca4e58efcfa47736b850404c36f7a (diff)
Add --exclude-processing option (#1963)
* add --exclude-processing option * update documentation * add tests and address some PR comments * fix linting errors * TODO comment --------- Co-authored-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/content/config.md14
-rw-r--r--docs/content/usage.md14
2 files changed, 28 insertions, 0 deletions
diff --git a/docs/content/config.md b/docs/content/config.md
index 60eac24a..a260c2d2 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -139,6 +139,20 @@ excludes:
This will skip all files with the extension `.txt`, except for files named
`include-this.txt`, which will be processed.
+## `excludeProcessing`
+
+See [`--exclude-processing`](../usage/#exclude-processing).
+
+This is an array of exclude patterns, used in conjunction with [`inputDir`](#inputdir).
+The matching files will be copied to the output directory without template rendering.
+
+```yaml
+excludeProcessing:
+ - '*.jpg'
+```
+
+This will copy all files with the extension `.jpg` to the output directory.
+
## `execPipe`
See [`--exec-pipe`](../usage/#exec-pipe).
diff --git a/docs/content/usage.md b/docs/content/usage.md
index 93156da0..52db98ff 100644
--- a/docs/content/usage.md
+++ b/docs/content/usage.md
@@ -130,6 +130,20 @@ $ gomplate --include *.tmpl --exclude foo*.tmpl --input-dir in/ --output-dir out
This will cause only files ending in `.tmpl` to be processed, except for files with names beginning with `foo`: `template.tmpl` will be included, but `foo-template.tmpl` will not.
+### `--exclude-processing`
+
+When using the [`--input-dir`](#input-dir-and-output-dir) argument, it can be useful to skip some files from processing and copy them directly to the output directory. Like the `--exclude` flag, it takes a [`.gitignore`][]-style pattern, and any files match the pattern will be copied.
+
+_Note:_ These patterns are _not_ treated as filesystem globs, and so a pattern like `/foo/bar.json` will match relative to the input directory, not the root of the filesystem as they may appear!
+
+Examples:
+
+```console
+$ gomplate --exclude-processing `*.png` --input-dir in/ --output-dir out/
+```
+
+This will skip all `*.png` files in the `in/` directory from being processed, and copy them to the `out/` directory.
+
#### `.gomplateignore` files
You can also use a file named `.gomplateignore` containing one exclude pattern on each line. This has the same syntax as a [`.gitignore`][] file.