mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-30 14:41:20 +00:00
Fix up error in copyEnv
This commit is contained in:
parent
b92bd8f6a8
commit
d4ab9679d7
@ -50,7 +50,8 @@ 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)
|
kv := strings.SplitN(e, "=", 2)
|
||||||
|
if len(kv) == 2 {
|
||||||
k, v := kv[0], kv[1]
|
k, v := kv[0], kv[1]
|
||||||
if strings.HasPrefix(k, prefix) && !strings.HasPrefix(k, ps) {
|
if strings.HasPrefix(k, prefix) && !strings.HasPrefix(k, ps) {
|
||||||
k2 := strings.Replace(k, prefix, ps, 1)
|
k2 := strings.Replace(k, prefix, ps, 1)
|
||||||
@ -58,6 +59,7 @@ func copyEnvVars(prefix string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// execute adds all child commands to the root command sets flags appropriately.
|
// execute adds all child commands to the root command sets flags appropriately.
|
||||||
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user