diff --git a/pkg/config/config.go b/pkg/config/config.go index bc2d602..c035f70 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -40,6 +40,7 @@ type Config struct { FailOnBundleErrors bool `yaml:"fail_on_bundles_errors,omitempty"` Bundles Bundles `yaml:"bundles,omitempty"` GrubOptions map[string]string `yaml:"grub_options,omitempty"` + Env []string `yaml:"env,omitempty"` } type Bundles []Bundle diff --git a/pkg/utils/env.go b/pkg/utils/env.go new file mode 100644 index 0000000..514ab66 --- /dev/null +++ b/pkg/utils/env.go @@ -0,0 +1,16 @@ +package utils + +import ( + "os" + "strings" +) + +func SetEnv(env []string) { + + for _, e := range env { + pair := strings.SplitN(e, "=", 2) + if len(pair) >= 2 { + os.Setenv(pair[0], pair[1]) + } + } +}