Skip to content

Commit

Permalink
fix default template check
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoYangyang0403 committed Sep 27, 2023
1 parent 4600ec7 commit 618e153
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ BugIt支持自动填充Lyrebird运行过程中抓取到的数据信息。

![BugIt获取报警信息](./image/bugit_alert.gif)

此外,还支持针对指定检查器的报警进行自动开Bug。

通过配置可以指定检查器,BugIt会将这些检查器的报警信息送入配置指定的脚本内,在脚本内自定义对报警信息的处理,即可实现Bug的自动上报功能。

## 缓存功能

按下[Commond]+[s]键,会将Bug相关字段信息进行存储。
Expand Down
19 changes: 14 additions & 5 deletions lyrebird_bugit/template_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ def get_workspace():


def get_default_template_path():
bugit_workspace = application.config.get('bugit.workspace', '')
bugit_default_template = application.config.get('bugit.default_template', '')
template_path = Path(bugit_workspace + bugit_default_template)
if bugit_default_template:
return template_path
bugit_workspace = application.config.get('bugit.workspace')
if not bugit_workspace:
return

bugit_default_template = application.config.get('bugit.default_template')
if not bugit_default_template:
return

return Path(bugit_workspace) / Path(bugit_default_template)


def template_list():
Expand Down Expand Up @@ -70,6 +74,11 @@ def template_check(template):
def default_template_check(template_path):
global autoissue_ready

if not template_path:
logger.error('Default template path is not configured.')
autoissue_ready = False
return

if not template_path.exists():
logger.error('Default template path is not existed.')
autoissue_ready = False
Expand Down

0 comments on commit 618e153

Please sign in to comment.