Skip to content

Commit

Permalink
updated tag
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-hermann-sva committed Mar 11, 2024
1 parent b7e4d5c commit cb5c200
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
11 changes: 11 additions & 0 deletions cmd/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package cmd
import (
"fmt"
"os"
"strings"

"github.com/stuttgart-things/machineshop/internal"
sthingsBase "github.com/stuttgart-things/sthingsBase"
Expand Down Expand Up @@ -134,6 +135,16 @@ var renderCmd = &cobra.Command{
// MERGE DEFAULTS + VALUES
variables := sthingsBase.MergeMaps(defaultVariables, flagVariables)

// CHECK FOR YAML LIST CONTENT
for key, values := range variables {

listContent, isList := sthingsBase.GetRegexSubMatch(values.(string), `\[(.*?)\]`)
if isList {
fmt.Println(key + " IS A LIST!")
variables[key] = strings.Split(listContent, " ")
}
}

// RENDER TEMPLATE
renderOption := "missingkey=error"
if forceRenderOption {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
github.com/go-git/go-git/v5 v5.8.1
github.com/pterm/pterm v0.12.62
github.com/spf13/cobra v1.7.0
github.com/stuttgart-things/machineShop v1.7.0
github.com/stuttgart-things/sthingsBase v0.1.31
github.com/stuttgart-things/sthingsCli v0.1.85
go.hein.dev/go-version v0.1.0
Expand Down Expand Up @@ -115,6 +114,7 @@ require (
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
Expand Down
3 changes: 1 addition & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,6 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stuttgart-things/machineShop v1.7.0 h1:SiH5FX3X4tGjM8ef6gtGqJpuI91aKjb3mtgxLADgy8o=
github.com/stuttgart-things/machineShop v1.7.0/go.mod h1:FGV8shbZSEZgI+06Yh3KxXpTEcljOofTe3OowGak+jo=
github.com/stuttgart-things/redisqueue v0.0.0-20230628084515-1d31f7874df7 h1:nVooDvBYhBPQysVjbvWP3S1CQgmNG/Vovt+ahmv9Cas=
github.com/stuttgart-things/redisqueue v0.0.0-20230628084515-1d31f7874df7/go.mod h1:RhH+7myjNLGs/BFeYO5U7ekmM7OsymsIOUN/DkewR3g=
github.com/stuttgart-things/sthingsBase v0.1.31 h1:CQJy4c2Np9ykRa/5p703Fcx2bVA+2willTOJSG0v7vk=
Expand Down Expand Up @@ -556,6 +554,7 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 h1:pVgRXcIictcr+lBQIFeiwuwtDIs4eL21OuM9nyAADmo=
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand Down

0 comments on commit cb5c200

Please sign in to comment.