Granted, when ~/.duck_token is missing, duck-gen must prompt the caller. A non-interactive execution fails like this:
$ nohup duck-gen >duck-gen.errout
nohup: ignoring input and redirecting stderr to stdout
$ cat duck-gen.errout
Enter your Duck Address: Enter the one-time passphrase sent to your email: Could not get Duck token: could not login: getLogin returned 401 Unauthorized
With this patch, we can fail faster:
$ go build && nohup ./duck-gen >duck-gen.errout ; cat duck-gen.errout
nohup: ignoring input and redirecting stderr to stdout
Enter your Duck Address: Could not get Duck token: could not get duck address
Granted, when
~/.duck_token
is missing,duck-gen
must prompt the caller. A non-interactive execution fails like this:With this patch, we can fail faster: