Browse Source

env: use foo= instead of foo="" for empty variables

to improve readability

Signed-off-by: Alejandro Mery <amery@jpi.io>
pull/45/head
Alejandro Mery 10 months ago
parent
commit
e410797413
  1. 6
      pkg/cluster/env.go

6
pkg/cluster/env.go

@ -117,7 +117,11 @@ func (m *Env) writeEnvVar(w io.Writer, value string, name string, args ...any) {
if name != "" {
value = strings.TrimSpace(value)
_, _ = fmt.Fprintf(w, "%s%s=%q\n", prefix, name, value)
if value == "" {
_, _ = fmt.Fprintf(w, "%s%s=\n", prefix, name)
} else {
_, _ = fmt.Fprintf(w, "%s%s=%q\n", prefix, name, value)
}
}
}

Loading…
Cancel
Save