You've already forked wakapi-readme-stats
Simplify logic to check default branch
This commit is contained in:
6
main.py
6
main.py
@@ -454,11 +454,7 @@ def get_stats(github):
|
|||||||
yearly_data = loc.calculateLoc()
|
yearly_data = loc.calculateLoc()
|
||||||
loc.plotLoc(yearly_data)
|
loc.plotLoc(yearly_data)
|
||||||
stats += '**' + translate['Timeline'] + '**\n\n'
|
stats += '**' + translate['Timeline'] + '**\n\n'
|
||||||
try:
|
branch_name = github.get_repo(f'{username}/{username}').default_branch
|
||||||
github.get_repo(f'{username}/{username}').get_branch('main')
|
|
||||||
branch_name = 'main'
|
|
||||||
except GithubException:
|
|
||||||
branch_name = 'master'
|
|
||||||
stats = stats + ' \n\n'
|
stats = stats + ' \n\n'
|
||||||
|
|
||||||
return stats
|
return stats
|
||||||
|
|||||||
Reference in New Issue
Block a user