1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-16 11:09:33 +02:00
sap-jenkins-library/pkg/cnbutils/env.go
2021-11-29 11:32:32 +01:00

23 lines
430 B
Go

package cnbutils
import (
"fmt"
"path/filepath"
)
func CreateEnvFiles(utils BuildUtils, platformPath string, env map[string]interface{}) error {
envDir := filepath.Join(platformPath, "env")
err := utils.MkdirAll(envDir, 0755)
if err != nil {
return err
}
for k, v := range env {
err = utils.FileWrite(filepath.Join(envDir, k), []byte(fmt.Sprintf("%v", v)), 0644)
if err != nil {
return err
}
}
return nil
}