using payload relative path by default

dev
Mzack9999 2021-12-06 21:05:45 +01:00
parent edc6e5f9b3
commit 72ec69e37d
1 changed files with 3 additions and 14 deletions

View File

@ -28,21 +28,10 @@ func (g *PayloadGenerator) validate(payloads map[string]interface{}, templatePat
changed := false
var dir string
if folderutil.IsWindowsOS() {
dir, payloadType = filepath.Split(filepath.Join(templatePath, payloadType))
} else {
dir, _ = filepath.Split(templatePath)
}
dir, _ := filepath.Split(templatePath)
templatePathInfo, _ := folderutil.NewPathInfo(dir)
payloadPathsToProbe, _ := templatePathInfo.MeshWith(payloadType)
templatePathInfo, err := folderutil.NewPathInfo(dir)
if err != nil {
return err
}
payloadPathsToProbe, err := templatePathInfo.MeshWith(payloadType)
if err != nil {
return err
}
for _, payloadPath := range payloadPathsToProbe {
if fileExists(payloadPath) {
payloads[name] = payloadPath