mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-12 09:05:39 +00:00
bugfix: Empty environment variable names causing exec failures on Windows, thanks @sirjmann92 ! (#353)
This commit is contained in:
@@ -380,7 +380,14 @@ func buildEnv(req *ExecutionRequest) []string {
|
||||
ret := append(os.Environ(), "OLIVETIN=1")
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user