Merge pull request #1246 from Infisical/patch-5

extract base from template source path
This commit is contained in:
Maidul Islam
2023-12-14 15:19:39 -05:00
committed by GitHub
+4 -1
View File
@@ -9,6 +9,7 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"os/signal" "os/signal"
"path"
"strings" "strings"
"sync" "sync"
"syscall" "syscall"
@@ -189,7 +190,9 @@ func ProcessTemplate(templatePath string, data interface{}, accessToken string)
"secret": secretFunction, "secret": secretFunction,
} }
tmpl, err := template.New(templatePath).Funcs(funcs).ParseFiles(templatePath) templateName := path.Base(templatePath)
tmpl, err := template.New(templateName).Funcs(funcs).ParseFiles(templatePath)
if err != nil { if err != nil {
return nil, err return nil, err
} }