Просмотр исходного кода

perf(server): Auto copy to new config 'oas1' when first use

huangrunheng 2 лет назад
Родитель
Сommit
05ae8f2c61
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      module/server/config_manager.py

+ 4 - 0
module/server/config_manager.py

@@ -22,6 +22,10 @@ class ConfigManager:
             if json.stem == 'template':
                 continue
             result.append(json.stem)
+        if len(result) == 0:
+            # 如果没有脚本文件 则创建一个
+            ConfigManager.copy(file='oas1', template='template')
+            result.append('oas1')
         return result
 
     @staticmethod