feat: 项目按创建顺序,从新到旧排序

This commit is contained in:
maxmon 2023-04-13 00:20:57 +08:00
parent 10331c932f
commit f1168a9315
1 changed files with 3 additions and 1 deletions

View File

@ -18,7 +18,9 @@ def index():
ret_info = ReturnInfo() ret_info = ReturnInfo()
try: try:
project_config_info = [] project_config_info = []
for project_name in os.listdir(PROJECTS): project_list = os.listdir(PROJECTS)
project_list.sort(key=lambda x: os.path.getctime(os.path.join(PROJECTS, x)), reverse=True)
for project_name in project_list:
project_config_name = PROJECT_CONFIG_PATH.format(project_name) project_config_name = PROJECT_CONFIG_PATH.format(project_name)
print(project_config_name) print(project_config_name)
if os.path.exists(project_config_name): if os.path.exists(project_config_name):