diff --git a/pkg/project/template_freader.go b/pkg/project/template_freader.go deleted file mode 100644 index 9bfd22e2..00000000 --- a/pkg/project/template_freader.go +++ /dev/null @@ -1,38 +0,0 @@ -package project - -import ( - "os" - "path/filepath" - - "github.com/apex/log" -) - -type tmplFileReader struct { - stackPtr *Stack -} - -func (t tmplFileReader) ReadFile(path string) (string, error) { - vfPath := filepath.Join(t.stackPtr.TemplateDir, path) - valuesFileContent, err := os.ReadFile(vfPath) - if err != nil { - log.Debugf(err.Error()) - return "", err - } - return string(valuesFileContent), nil -} - -func (t tmplFileReader) TemplateFile(path string) (string, error) { - vfPath := filepath.Join(t.stackPtr.TemplateDir, path) - rawFile, err := os.ReadFile(vfPath) - if err != nil { - log.Debugf(err.Error()) - return "", err - } - templatedFile, errIsWarn, err := t.stackPtr.TemplateTry(rawFile, vfPath) - if err != nil { - if !errIsWarn { - return "", err - } - } - return string(templatedFile), nil -} diff --git a/pkg/project/templating.go b/pkg/project/templating.go index d5f3d743..b5252a04 100644 --- a/pkg/project/templating.go +++ b/pkg/project/templating.go @@ -55,7 +55,7 @@ func (f *ExtendedFuncMap) Get(path string, s *Stack) template.FuncMap { p = config.Global.ProjectConfigsPath } else { pathFuncName = "templatePath" - p = filepath.Join(s.TemplateDir) + p = filepath.Join(config.Global.ProjectConfigsPath, s.TemplateDir) } getPath := func() string { return p