Skip to content

Commit

Permalink
ignore template error
Browse files Browse the repository at this point in the history
  • Loading branch information
moficodes committed Dec 8, 2020
1 parent 2cf4c10 commit 7a1e814
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/bin
.idea/

# Logs
logs
Expand Down
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"archive/zip"
"bytes"
"fmt"
"html/template"
"io"
"io/ioutil"
"log"
Expand All @@ -13,6 +12,7 @@ import (
"path/filepath"
"strconv"
"strings"
"text/template"

"github.com/mitchellh/go-homedir"
)
Expand Down Expand Up @@ -205,7 +205,12 @@ func ProcessFiles(folder string, data Data) error {
}

filecontent := string(b)
fileTemplate := template.Must(template.New("file").Parse(filecontent))
fileTemplate, err := template.New("file").Parse(filecontent)

if err != nil {
return nil
}

buf := new(bytes.Buffer)

if err := fileTemplate.Execute(buf, data); err != nil {
Expand Down

0 comments on commit 7a1e814

Please sign in to comment.