fixing typo and adding message for retrieving API Token from file
This commit is contained in:
parent
47f5691c0b
commit
ad869f9df6
1 changed files with 5 additions and 2 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue