Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
5311bf40
Commit
5311bf40
authored
Mar 13, 2018
by
scriptonist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now returning error and stopping installation
parent
6cfaa4eb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
engine.go
pkg/engine/engine.go
+4
-5
No files found.
pkg/engine/engine.go
View file @
5311bf40
...
...
@@ -19,7 +19,6 @@ package engine
import
(
"bytes"
"fmt"
"log"
"path"
"sort"
"strings"
...
...
@@ -197,7 +196,7 @@ func (e *Engine) alterFuncMap(t *template.Template) template.FuncMap {
}
// render takes a map of templates/values and renders them.
func
(
e
*
Engine
)
render
(
tpls
map
[
string
]
renderable
)
(
map
[
string
]
string
,
error
)
{
func
(
e
*
Engine
)
render
(
tpls
map
[
string
]
renderable
)
(
rendered
map
[
string
]
string
,
err
error
)
{
// Basically, what we do here is start with an empty parent template and then
// build up a list of templates -- one for each file. Once all of the templates
// have been parsed, we loop through again and execute every template.
...
...
@@ -206,8 +205,8 @@ func (e *Engine) render(tpls map[string]renderable) (map[string]string, error) {
// to share common blocks, but to make the entire thing feel like a file-based
// template engine.
defer
func
()
{
if
err
:=
recover
();
er
r
!=
nil
{
log
.
Printf
(
"rendering template failed: %v
\n
"
,
er
r
)
if
r
:=
recover
();
r
!=
nil
{
err
=
fmt
.
Errorf
(
"rendering template failed: %v"
,
r
)
}
}()
t
:=
template
.
New
(
"gotpl"
)
...
...
@@ -247,7 +246,7 @@ func (e *Engine) render(tpls map[string]renderable) (map[string]string, error) {
}
}
rendered
:
=
make
(
map
[
string
]
string
,
len
(
files
))
rendered
=
make
(
map
[
string
]
string
,
len
(
files
))
var
buf
bytes
.
Buffer
for
_
,
file
:=
range
files
{
// Don't render partials. We don't care out the direct output of partials.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment