Skip to content

Commit

Permalink
Fixed remote installer accepting TOS in non-interactive mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchell-as committed Dec 18, 2024
1 parent 86fb843 commit 9d57da8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/state-remote-installer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,13 @@ func main() {
}

func execute(out output.Outputer, prompt prompt.Prompter, cfg *config.Instance, an analytics.Dispatcher, args []string, params *Params) error {
if params.nonInteractive {
prompt.SetInteractive(false)
}
defaultChoice := params.nonInteractive
msg := locale.Tr("tos_disclaimer", constants.TermsOfServiceURLLatest)
msg += locale.Tr("tos_disclaimer_prompt", constants.TermsOfServiceURLLatest)
cont, err := prompt.Confirm(locale.Tr("install_remote_title"), msg, ptr.To(true), nil)
cont, err := prompt.Confirm(locale.Tr("install_remote_title"), msg, &defaultChoice, nil)
if err != nil {
return errs.Wrap(err, "Not confirmed")
}
Expand Down

0 comments on commit 9d57da8

Please sign in to comment.