Skip to content

Commit 9d57da8

Browse files
committed
Fixed remote installer accepting TOS in non-interactive mode.
1 parent 86fb843 commit 9d57da8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/state-remote-installer/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,13 @@ func main() {
173173
}
174174

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

0 commit comments

Comments
 (0)