mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-23 04:07:45 +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)
|
kv := strings.SplitN(value, "=", 2)
|
||||||
if len(kv) == 1 {
|
if len(kv) == 1 {
|
||||||
if defaultEnv {
|
if defaultEnv {
|
||||||
result[kv[0]] = os.Getenv(kv[0])
|
v, ok := os.LookupEnv(kv[0])
|
||||||
|
if ok {
|
||||||
|
result[kv[0]] = v
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
result[kv[0]] = ""
|
result[kv[0]] = ""
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user