Skip to content

Commit

Permalink
Match colored output consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
andres-lowrie committed Dec 14, 2018
1 parent 227cbff commit b24f486
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion snippet/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (snippet *Snippet) ConvertToShellScript() string {
// headline
shellCmds = append(shellCmds, "#!/bin/bash")
// convert title
titleShell := fmt.Sprintf("echo -e \"%s\"\n", green(fmt.Sprintf("Start executing snippet %s...", snippet.Title))
titleShell := fmt.Sprintf("echo -e \"%s\"\n", green(fmt.Sprintf("Start executing snippet %s...", snippet.Title)))
shellCmds = append(shellCmds, titleShell)
// convert each step
for idx, step := range snippet.Steps {
Expand Down
4 changes: 2 additions & 2 deletions snippet/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (step *StepInfo) AskQuestion(options ...interface{}) error {

func (step *StepInfo) ConvertToShellScript(templates *TemplateFieldMap) string {
green := color.New(color.FgGreen).SprintFunc()
yellow := color.New(color.Yello).SprintFunc()
yellow := color.New(color.FgYellow).SprintFunc()

shellCmds := make([]string, 0)
templateFieldsMap := ParseTemplateFieldsMap(step.Command)
Expand All @@ -62,7 +62,7 @@ func (step *StepInfo) ConvertToShellScript(templates *TemplateFieldMap) string {
defaultValPrompt = existingTf.Value
defaultValueShell = fmt.Sprintf("%s=${%s:-%s}", field, field, existingTf.Value)
}
inputPromptShell := fmt.Sprintf(`read -p "Enter value for <%s> (default: %s): " %s`, green(field), green(defaultValPrompt), field)
inputPromptShell := fmt.Sprintf("read -p \"%s\" %s", green(fmt.Sprintf("Enter value for <%s> (default: %s):", field, defaultValPrompt)), field)
existingTf.Asked = true
shellCmds = append(shellCmds, inputPromptShell, defaultValueShell)
}
Expand Down

0 comments on commit b24f486

Please sign in to comment.