diff --git a/src/bank/teller/init.go b/src/bank/teller/init.go new file mode 100644 index 0000000..5a8aa2a --- /dev/null +++ b/src/bank/teller/init.go @@ -0,0 +1,20 @@ +package teller + +import ( + "bufio" + "context" + "fmt" + "os" + "strings" +) + +func Init(ctx context.Context) error { + if Token == "" { + } else if reader := bufio.NewReader(os.Stdin); false { + } else if fmt.Println("Token already exists; are you sure [nY]?"); false { + } else if text, _ := reader.ReadString('\n'); !strings.Contains(text, "Y") { + return fmt.Errorf("token already exists") + } + + return ctx.Err() +} diff --git a/src/bank/teller/token.txt b/src/bank/teller/token.txt index 8b13789..e69de29 100644 --- a/src/bank/teller/token.txt +++ b/src/bank/teller/token.txt @@ -1 +0,0 @@ -