diff --git a/main.py b/main.py index c083be1..b056db2 100644 --- a/main.py +++ b/main.py @@ -155,6 +155,13 @@ def generate_commit_list(): def get_stats(): '''Gets API data and returns markdown progress''' stats = '' + + if showCommit.lower() in ['true', '1', 't', 'y', 'yes']: + try: + stats = stats + generate_commit_list() + '\n\n' + except Exception as ex: + print("GitHub Personal access token not configured properly or invalid" + str(ex)) + try: request = requests.get( f"https://wakatime.com/api/v1/users/current/stats/last_7_days?api_key={waka_key}") @@ -189,12 +196,6 @@ def get_stats(): except Exception as e: print("Waka Time Api Key Not Configured" + str(e)) - if showCommit.lower() in ['true', '1', 't', 'y', 'yes']: - try: - stats = stats + generate_commit_list() + '\n\n' - except Exception as ex: - print("GitHub Personal access token not configured properly or invalid" + str(ex)) - return stats