Spaces:
Runtime error
Runtime error
Merge pull request #438 from mrhblfx/patch-1
Browse files增加了解析Go项目匹配的文件: `go.mod`, `go.sum`, `go.work`
crazy_functions/解析项目源代码.py
CHANGED
|
@@ -225,7 +225,10 @@ def 解析一个Golang项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, s
|
|
| 225 |
report_execption(chatbot, history, a=f"解析项目: {txt}", b=f"找不到本地项目或无权访问: {txt}")
|
| 226 |
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|
| 227 |
return
|
| 228 |
-
file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.go', recursive=True)]
|
|
|
|
|
|
|
|
|
|
| 229 |
if len(file_manifest) == 0:
|
| 230 |
report_execption(chatbot, history, a=f"解析项目: {txt}", b=f"找不到任何golang文件: {txt}")
|
| 231 |
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|
|
|
|
| 225 |
report_execption(chatbot, history, a=f"解析项目: {txt}", b=f"找不到本地项目或无权访问: {txt}")
|
| 226 |
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|
| 227 |
return
|
| 228 |
+
file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.go', recursive=True)] + \
|
| 229 |
+
[f for f in glob.glob(f'{project_folder}/**/go.mod', recursive=True)] + \
|
| 230 |
+
[f for f in glob.glob(f'{project_folder}/**/go.sum', recursive=True)] + \
|
| 231 |
+
[f for f in glob.glob(f'{project_folder}/**/go.work', recursive=True)]
|
| 232 |
if len(file_manifest) == 0:
|
| 233 |
report_execption(chatbot, history, a=f"解析项目: {txt}", b=f"找不到任何golang文件: {txt}")
|
| 234 |
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|