Skip to content

Commit

Permalink
fix env string join
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrohb88 authored and rafaelsq committed Oct 15, 2021
1 parent ee9d913 commit 624c72a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/wtc/wtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func readConfig(config *Config, filePath string) (bool, error) {
keys := make(map[string]string, len(envs))
for _, v := range envs {
pieces := strings.Split(v, "=")
keys[pieces[0]] = pieces[1]
keys[pieces[0]] = strings.Join(pieces[1:], "=")
}

replaceEnvRe := regexp.MustCompile(`(i?)\%\{[A-Z0-9_]+\}\%`)
Expand Down Expand Up @@ -457,7 +457,7 @@ func trig(rule *Rule, pkg, path string) error {
envs := os.Environ()
for _, v := range envs {
pieces := strings.Split(v, "=")
keys[pieces[0]] = pieces[1]
keys[pieces[0]] = strings.Join(pieces[1:], "=")
}
for _, e := range append(config.Env, rule.Env...) {
if strings.ToLower(e.Type) == "file" {
Expand Down Expand Up @@ -494,7 +494,7 @@ func trig(rule *Rule, pkg, path string) error {
if len(l) > 0 && l[0] != '#' {
pieces := strings.Split(exportRe.ReplaceAllString(l, ""), "=")
if len(pieces) > 1 {
keys[strings.TrimSpace(pieces[0])] = pieces[1]
keys[strings.TrimSpace(pieces[0])] = strings.Join(pieces[1:], "=")
}
}
}
Expand Down

0 comments on commit 624c72a

Please sign in to comment.