Skip to content

Commit

Permalink
fixes for printmode
Browse files Browse the repository at this point in the history
  • Loading branch information
redradrat committed Oct 10, 2020
1 parent 4e0bdad commit 20bf82a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 1 addition & 3 deletions kable/cmd/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ func PrintTable(headers []string, lines ...[]string) {
}

func PrintError(format string, a ...interface{}) {
if !silent {
fmt.Println(fmt.Errorf(color.RedString("! "+format, a...)))
}
fmt.Println(fmt.Errorf(color.RedString("! "+format, a...)))
os.Exit(1)
}

Expand Down
16 changes: 11 additions & 5 deletions kable/cmd/renderConcept.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,25 @@ kable render -l . -o out/
} else {
PrintError("error parsing existing renderinfo: %s", err)
}
} else {
}

// Ask for values if renderinfo does not exist
if existingRenderInfo {
vals := *ri.Values
for k, _ := range cpt.Inputs.Mandatory {
if _, ok := vals[k]; !ok {
outdatedValues = true
}
}
avs = &vals
}

// Ask for values if renderinfo does not exist or values are outdated
if !existingRenderInfo || outdatedValues {
PrintMsg("No existing render or outdated values detected...")
if outdatedValues {
PrintError("Detected outdated values in renderinfo.json")
}
} else {
if printOnly {
PrintError("Cannot use print mode without preexisting renderinfo.json")
}
avs, err = NewInputDialog(cpt.Inputs).RunInputDialog()
if err != nil {
PrintError("error processing concept inputs: %s", err)
Expand Down

0 comments on commit 20bf82a

Please sign in to comment.