|
@ -50,11 +50,13 @@ func copyEnvVars(prefix string) { |
|
|
prefix = strings.ToUpper(prefix) |
|
|
prefix = strings.ToUpper(prefix) |
|
|
ps := prefix + "_" |
|
|
ps := prefix + "_" |
|
|
for _, e := range os.Environ() { |
|
|
for _, e := range os.Environ() { |
|
|
kv := strings.SplitN(e, "=", 1) |
|
|
|
|
|
k, v := kv[0], kv[1] |
|
|
|
|
|
if strings.HasPrefix(k, prefix) && !strings.HasPrefix(k, ps) { |
|
|
|
|
|
k2 := strings.Replace(k, prefix, ps, 1) |
|
|
|
|
|
os.Setenv(k2, v) |
|
|
|
|
|
|
|
|
kv := strings.SplitN(e, "=", 2) |
|
|
|
|
|
if len(kv) == 2 { |
|
|
|
|
|
k, v := kv[0], kv[1] |
|
|
|
|
|
if strings.HasPrefix(k, prefix) && !strings.HasPrefix(k, ps) { |
|
|
|
|
|
k2 := strings.Replace(k, prefix, ps, 1) |
|
|
|
|
|
os.Setenv(k2, v) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|