This repository was archived by the owner on Jan 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package main
33import (
44 "fmt"
55 "io"
6+ "os"
67
78 "github.com/facebookgo/stackerr"
89 "github.com/spf13/cobra"
@@ -34,7 +35,24 @@ func (c *configureCmd) accountKey(e *env) error {
3435 if c .tokenReader != nil {
3536 l .tokenReader = c .tokenReader
3637 }
37- foundEmail , creds , _ := l .getTokenCredentials (e , email )
38+ foundEmail , creds , err := l .getTokenCredentials (e , email )
39+ if stackerr .HasUnderlying (err , stackerr .MatcherFunc (os .IsNotExist )) && ! c .isDefault {
40+ fmt .Fprintln (
41+ e .Out ,
42+ `
43+
44+ Looks like you have not configured the default account key yet.
45+ Note that "parse new" and "parse list" can automatically pick up a default key if present.
46+ Otherwise, you'll have to explicitly set the PARSER_EMAIL environment variable
47+ for it to know which account key to use.
48+ Further, if the command line tool cannot find an account key for a configured email it will try to
49+ use the default account key
50+
51+ To configure the default account key use:
52+ "parse configure accountkey -d"` ,
53+ )
54+ }
55+
3856 if creds != nil {
3957 if c .isDefault {
4058 fmt .Fprintln (
You can’t perform that action at this time.
0 commit comments