clone时修改项目名,也能正确找到项目根目录

This commit is contained in:
玄凤科技
2025-02-14 14:35:04 +08:00
parent d2ecff8e6c
commit ce64a76dcf
+2 -3
View File
@@ -5,9 +5,8 @@ import socket
def get_project_dir():
projectName = 'xiaozhi-esp32-server'
filePath = os.path.abspath(__file__)
return filePath[:filePath.rfind('/' + projectName + '/') + len(projectName) + 2]
"""获取项目根目录"""
return os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))+'/'
def get_local_ip():