mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-22 19:57:44 +08:00
Merge pull request #221 from cpuguy83/build_args_env
build: only use env for args if set
This commit is contained in:
commit
5a79b401b0
@ -305,7 +305,10 @@ func listToMap(values []string, defaultEnv bool) map[string]string {
|
||||
kv := strings.SplitN(value, "=", 2)
|
||||
if len(kv) == 1 {
|
||||
if defaultEnv {
|
||||
result[kv[0]] = os.Getenv(kv[0])
|
||||
v, ok := os.LookupEnv(kv[0])
|
||||
if ok {
|
||||
result[kv[0]] = v
|
||||
}
|
||||
} else {
|
||||
result[kv[0]] = ""
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user