bugfix: Empty environment variable names causing exec failures on Windows, thanks @sirjmann92 ! (#353)
This commit is contained in:
parent
897cc0e034
commit
9dd33bc3f9
|
|
@ -380,7 +380,14 @@ func buildEnv(req *ExecutionRequest) []string {
|
||||||
ret := append(os.Environ(), "OLIVETIN=1")
|
ret := append(os.Environ(), "OLIVETIN=1")
|
||||||
|
|
||||||
for k, v := range req.Arguments {
|
for k, v := range req.Arguments {
|
||||||
ret = append(ret, fmt.Sprintf("%v=%v", strings.ToUpper(k), v))
|
varName := fmt.Sprintf("%v", strings.TrimSpace(strings.ToUpper(k)))
|
||||||
|
|
||||||
|
// Skip arguments that might not have a name (eg, confirmation), as this causes weird bugs on Windows.
|
||||||
|
if varName == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = append(ret, fmt.Sprintf("%v=%v", varName, v))
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue