Skip to content

Commit

Permalink
Make ToS non-interactive err message more descriptive (#7562)
Browse files Browse the repository at this point in the history
* add descriptive err msg

* Update shared/tos/tos.go

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
  • Loading branch information
bidlocode and prestonvanloon committed Oct 18, 2020
1 parent b502876 commit 53ab1df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion shared/tos/tos.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ TERMS AND CONDITIONS: https://github.com/prysmaticlabs/prysm/blob/master/TERMS_O
Type "accept" to accept this terms and conditions [accept/decline]:`
acceptTosPromptErrText = `
Could not scan text input. If you are trying to run in non-interactive environment, you
should use --accept-terms-of-use flag (only once) after reading the terms and conditions here:
https://github.com/prysmaticlabs/prysm/blob/master/TERMS_OF_SERVICE.md
`
)

var (
Expand All @@ -51,7 +56,7 @@ func VerifyTosAcceptedOrPrompt(ctx *cli.Context) error {

input, err := promptutil.DefaultPrompt(au.Bold(acceptTosPromptText).String(), "decline")
if err != nil {
return err
return errors.New(acceptTosPromptErrText)
}
if strings.ToLower(input) != "accept" {
return errors.New("you have to accept Terms and Conditions in order to continue")
Expand Down

0 comments on commit 53ab1df

Please sign in to comment.