()
| 172 | current_year = datetime.today().year |
| 173 | |
| 174 | def get_git_user_name(): |
| 175 | try: |
| 176 | result = subprocess.run(['git', 'config', 'user.name'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) |
| 177 | if result.returncode == 0: |
| 178 | return result.stdout.strip() |
| 179 | else: |
| 180 | return "Unknown Author" |
| 181 | except Exception as e: |
| 182 | return "Unknown Author" |
| 183 | |
| 184 | # 获取 Git 用户名 |
| 185 | author_name = get_git_user_name() |