1. Try to fix git issues.

2. Fix EN lang issues.
1. 尝试修复git错误
2. 修复英文版部分断句错误
This commit is contained in:
Pentacene 2021-04-13 15:32:34 +08:00
parent c7521698ac
commit ca102639ad
4 changed files with 34 additions and 6 deletions

View File

@ -228,10 +228,10 @@ coin_lost: I lost my coin
# help
## lang
lang_des: Switch language.
lang_change_to: The language has been switched to
lang_change_to: The language has been switched to
lang_reboot: Restarting.
lang_current_lang: The current language is
lang_all_lang: All available languages are
lang_current_lang: The current language is
lang_all_lang: All available languages are
# message
## id
@ -434,7 +434,7 @@ chat_join_success: You have successfully joined
#update
## update
update_des: Check for updates from remote sources and install them to PagerMaid-Modify.
update_processing: Checking the remote source for update..."
update_processing: Checking the remote source for update...
update_platform_version: system version number
update_git_version: Git version number
update_local_git_change: local modification
@ -453,3 +453,6 @@ update_hint: Please use the following command to update
update_found_pulling: An update was found and is being pulled...
update_success: Update successfully
update_failed: update failed
update_auto_upgrade_git_failed_ubuntu: It is detected that your system is Ubuntu or Debain. Try to upgrade git automatically but failed. Please upgrade manually.
update_auto_upgrade_git_failed_cent: It is detected that your system is CentOS, try to upgrade git automatically but failed, please upgrade manually.
update_auto_upgrade_git_hint: Your git version is too low and has tried to automatically upgrade for you. If you are reminded of this error again, please upgrade manually.

View File

@ -451,3 +451,6 @@ update_hint: 请使用以下命令进行更新
update_found_pulling: 找到更新,正在拉取 . . .
update_success: 更新成功
update_failed: 更新失败
update_auto_upgrade_git_failed_ubuntu: 检测到您的系统是Ubuntu或Debain尝试自动升级git但失败,请手动升级.
update_auto_upgrade_git_failed_cent: 检测到您的系统是CentOS尝试自动升级git但失败,请手动升级.
update_auto_upgrade_git_hint: 您的git版本过低,已尝试为您自动升级. 如再次提醒此错误,请手动升级.

View File

@ -65,7 +65,29 @@ async def update(context):
upstream_remote = repo.remote('upstream')
upstream_remote.fetch(active_branch)
changelog = await changelog_gen(repo, f'HEAD..upstream/{active_branch}')
try:
changelog = await changelog_gen(repo, f'HEAD..upstream/{active_branch}')
except:
distribution = await execute('lsb_release -a')
if distribution.find('Ubuntu') != -1 or distribution.find('Debain') != -1:
try:
await execute('apt-get install --upgrade git -y')
except:
await context.edit(lang('update_failed') + '\n' + lang('update_auto_upgrade_git_failed_ubuntu'))
return
elif distribution.find('Cent') != -1:
try:
await execute('yum install git -y')
except:
await context.edit(lang('update_failed') + '\n' + lang('update_auto_upgrade_git_failed_cent'))
return
else:
try:
await execute('apt-get install --upgrade git -y')
await execute('yum install git -y')
except:
pass
await context.edit(lang('update_auto_upgrade_git_hint'))
if not parameter:

View File

@ -21,7 +21,7 @@ pillow
python-magic
pygments
distutils2-py3
speedtest-cli
speedtest-cli>=2.1.3
gitpython
werkzeug
flask