mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-16 11:09:33 +02:00
ac09e6e4aa
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
23 lines
430 B
Go
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
|
|
}
|