Pass a logger in to getApiClient() rather than constructing one there.

This commit is contained in:
Chris Gavin 2020-11-02 08:53:25 +00:00
parent 1f7bae7ab8
commit 865b4bd832
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
12 changed files with 29 additions and 27 deletions

View file

@ -598,7 +598,7 @@ async function getLanguagesInRepo(
): Promise<Language[]> {
logger.debug(`GitHub repo ${repository.owner} ${repository.repo}`);
const response = await api
.getApiClient(githubAuth, githubUrl, mode, true)
.getApiClient(githubAuth, githubUrl, mode, logger, true)
.repos.listLanguages({
owner: repository.owner,
repo: repository.repo,
@ -798,7 +798,13 @@ async function loadConfig(
configFile = path.resolve(checkoutPath, configFile);
parsedYAML = getLocalConfig(configFile, checkoutPath);
} else {
parsedYAML = await getRemoteConfig(configFile, githubAuth, githubUrl, mode);
parsedYAML = await getRemoteConfig(
configFile,
githubAuth,
githubUrl,
mode,
logger
);
}
// Validate that the 'name' property is syntactically correct,
@ -1022,7 +1028,8 @@ async function getRemoteConfig(
configFile: string,
githubAuth: string,
githubUrl: string,
mode: Mode
mode: Mode,
logger: Logger
): Promise<UserConfig> {
// retrieve the various parts of the config location, and ensure they're present
const format = new RegExp(
@ -1035,7 +1042,7 @@ async function getRemoteConfig(
}
const response = await api
.getApiClient(githubAuth, githubUrl, mode, true)
.getApiClient(githubAuth, githubUrl, mode, logger, true)
.repos.getContent({
owner: pieces.groups.owner,
repo: pieces.groups.repo,