Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef Gabrielsson committed Mar 7, 2022
1 parent b635c3e commit 8f73d70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
21 changes: 4 additions & 17 deletions dotyaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,22 +241,6 @@ func normalizeValueColonsPair(field interface{}) string {
return val
}

func normalizeValueStrings(field interface{}) string {
values := normalizeValue(field)
size := len(values)
val := ""

if size == 0 {
return fmt.Sprint(field)
}

for _, r := range values {
fmt.Println(r)
val += r + " "
}
return val
}

func transformPairs(s string) *YamlPairs {
split := strings.Split(s, "=")
var k, v string
Expand Down Expand Up @@ -291,7 +275,10 @@ func convertToArray(t interface{}) []string {
}

func convertToString(p []string) string {
str := strings.Join(p, " ")
str := ""
if len(p) > 0 {
str = strings.Join(p, " ")
}
return str
}

Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func buildCommand(e *Yaml, l []EnvironmentVariable) Command {

if v.Entrypoint != nil {
p := normalizeValue(v.Entrypoint)
arr = append(arr, "--entrypoint", convertToString(p))
arr = append(arr, "--entrypoint", "'"+convertToString(p)+"'")
}

for _, r := range normalizeValue(v.Environment) {
Expand All @@ -269,8 +269,8 @@ func buildCommand(e *Yaml, l []EnvironmentVariable) Command {
}

if v.Healthcheck.Test != "" {
values := normalizeValueStrings(v.Healthcheck.Test)
arr = append(arr, "--health-cmd", "'"+values+"'")
p := normalizeValue(v.Healthcheck.Test)
arr = append(arr, "--health-cmd", "'"+convertToString(p)+"'")
}

if v.Healthcheck.Interval != "" {
Expand Down

0 comments on commit 8f73d70

Please sign in to comment.