Skip to content

Commit

Permalink
Also build it for you
Browse files Browse the repository at this point in the history
  • Loading branch information
melroy89 authored and akhilmhdh committed May 3, 2024
1 parent 0b5562f commit d2ccc98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33929,15 +33929,22 @@ const getUserInfo = async (login, avatarUrl, prevContributors, useUserName) => {
const {
data: { name, avatar_url }
} = await src_octokit.rest.users.getByUsername({ username: login });
return { name: useUserName ? login : htmlEncoding(name), url: avatar_url };
// Use login (== username) when useUserName is true, otherwise try to use name.
// Unless name is null, then fallback to login.
const finalName = (useUserName) ? login: (name) ? capitalize(htmlEncoding(name)) : login
return { name: finalName, url: avatar_url };
} catch (error) {
console.log(`Oops...given github id ${login} is invalid :(`);
return { name: login, url: '' };
}
}

// Use login (== username) when useUserName is true, otherwise try to use name.
// If name is null, then fallback to login.
const finalName = (useUserName) ? login : (prevContributors[login] && prevContributors[login].name) ?
capitalize(htmlEncoding(prevContributors[login].name)) : login
return {
name: useUserName ? login : htmlEncoding(prevContributors[login].name),
name: finalName,
url: avatarUrl || prevContributors[login].url
};
};
Expand Down Expand Up @@ -33980,7 +33987,7 @@ const templateBuilder = async (contributors, prevContributors, type) => {
contributors_content += getTemplate(
login,
imageSize,
useUsername ? name : capitalize(name),
name,
url
);
} else {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit d2ccc98

Please sign in to comment.