Commit 31d6dcb6 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

template: template path is the directory

parent 2b9e52e7
......@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"text/template"
......@@ -99,7 +100,7 @@ func funcGenTemplatePath(ctx *Context) interface{} {
return "", errors.New("template path not available")
}
return ctx.TemplatePath, nil
return filepath.Dir(ctx.TemplatePath), nil
}
}
......
......@@ -128,7 +128,7 @@ func TestFuncTemplatePath(t *testing.T) {
}
ctx := &Context{
TemplatePath: "foo",
TemplatePath: "foo/bar",
}
for _, tc := range cases {
i := &I{Value: tc.Input}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment