summaryrefslogtreecommitdiff
path: root/service/env/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/env/service.go')
-rw-r--r--service/env/service.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/service/env/service.go b/service/env/service.go
index 4d1327d4..83175b36 100644
--- a/service/env/service.go
+++ b/service/env/service.go
@@ -39,3 +39,17 @@ func (s *Service) GetEnv() (map[string]string, error) {
func (s *Service) SetEnv(key, value string) {
s.values[key] = value
}
+
+// Copy all environment values.
+func (s *Service) Copy(setter Setter) error {
+ values, err := s.GetEnv()
+ if err != nil {
+ return err
+ }
+
+ for k, v := range values {
+ setter.SetEnv(k, v)
+ }
+
+ return nil
+}