fixing typo and adding message for retrieving API Token from file

This commit is contained in:
Samantha Marshall 2017-03-13 13:38:32 -04:00
commit ad869f9df6
No known key found for this signature in database
GPG key ID: DF782CB74434EFA2

View file

@ -52,12 +52,15 @@ proc getGithubAuth(cfg: Config): Auth =
if existsEnv(ApiTokenEnvironmentVariable):
result.token = getEnv(ApiTokenEnvironmentVariable)
display("Info:", "Using the '" & ApiTokenEnvironmentVariable &
"' environment varaible for the GitHub API Token.",
"' environment variable for the GitHub API Token.",
priority = HighPriority)
else:
# try to read from disk, if it cannot be found write a new one
try:
result.token = readFile(cfg.nimbleDir / ApiKeyFile)
let api_token_file_path = cfg.nimbleDir / ApiKeyFile
result.token = readFile(api_token_file_path)
display("Info:", "Using GitHub API Token in file: " & api_token_file_path,
priority = HighPriority)
except IOError:
result.token = requestNewToken(cfg)