diff options
| author | George Kelly <gdog.kelly@googlemail.com> | 2017-10-30 22:14:45 +0000 |
|---|---|---|
| committer | George Kelly <gdog.kelly@googlemail.com> | 2017-11-27 20:04:32 +0000 |
| commit | 0e33e6fc712d31b742f470cc69d4166c2804ee5e (patch) | |
| tree | edcdaad482b05d887ed51af61aca46985f3eee9a /gomplate.go | |
| parent | 99b5cec8b37e25418bbfe2fc251f2adfd57603a2 (diff) | |
Can now pass --exclude as a flag
exclude takes a glob and ensures that any files found in that glob
aren't parsed
Diffstat (limited to 'gomplate.go')
| -rw-r--r-- | gomplate.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gomplate.go b/gomplate.go index fcc5792f..45cb2548 100644 --- a/gomplate.go +++ b/gomplate.go @@ -2,6 +2,7 @@ package main import ( "io" + "path/filepath" "text/template" "github.com/hairyhenderson/gomplate/data" @@ -45,11 +46,16 @@ func runTemplate(o *GomplateOpts) error { g := NewGomplate(d, o.lDelim, o.rDelim) + excludeList, err := filepath.Glob(o.excludeGlob) + if err != nil { + return err + } + if o.inputDir != "" { - return processInputDir(o.inputDir, o.outputDir, g) + return processInputDir(o.inputDir, o.outputDir, excludeList, g) } - return processInputFiles(o.input, o.inputFiles, o.outputFiles, g) + return processInputFiles(o.input, o.inputFiles, o.outputFiles, excludeList, g) } // Called from process.go ... |
