mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-12-16 13:40:53 +08:00
🐛 修复检查更新
This commit is contained in:
parent
8bd053cfee
commit
7b58799156
@ -1,5 +1,4 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import time
|
|
||||||
import git
|
import git
|
||||||
from nonebot.utils import run_sync
|
from nonebot.utils import run_sync
|
||||||
from git.exc import GitCommandError, InvalidGitRepositoryError
|
from git.exc import GitCommandError, InvalidGitRepositoryError
|
||||||
@ -19,7 +18,7 @@ async def check_update():
|
|||||||
local_commit = repo.head.commit
|
local_commit = repo.head.commit
|
||||||
remote_commit = []
|
remote_commit = []
|
||||||
for commit in data:
|
for commit in data:
|
||||||
if local_commit.binsha == commit['sha']:
|
if str(local_commit) == commit['sha']:
|
||||||
break
|
break
|
||||||
remote_commit.append(commit)
|
remote_commit.append(commit)
|
||||||
if not remote_commit:
|
if not remote_commit:
|
||||||
@ -45,4 +44,4 @@ def update():
|
|||||||
return f'更新失败,错误信息:{e},请手动进行更新'
|
return f'更新失败,错误信息:{e},请手动进行更新'
|
||||||
finally:
|
finally:
|
||||||
repo.git.stash('pop')
|
repo.git.stash('pop')
|
||||||
return f'更新完成,版本:{__version__}\n可使用命令[@bot 重启]重启{NICKNAME}'
|
return f'更新完成,版本:{__version__}\n最新更新日志为:\n{repo.head.commit.message.replace(":bug:", "🐛").replace(":sparkles:", "✨").replace(":memo:", "📝")}\n可使用命令[@bot 重启]重启{NICKNAME}'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user