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

清除已不存在的表所生成的旧文件 (#508)

清除已不存在的表所生成的旧文件
FistChina 2 лет назад
Родитель
Сommit
e4940ada0d
1 измененных файлов с 18 добавлено и 0 удалено
  1. 18 0
      Share/Tool/ExcelExporter/ExcelExporter.cs

+ 18 - 0
Share/Tool/ExcelExporter/ExcelExporter.cs

@@ -67,6 +67,7 @@ namespace ET
 
         private const string clientProtoDir = "../Unity/Assets/Bundles/Config";
         private const string serverProtoDir = "../Config/Excel/{0}/{1}";
+        private const string replaceStr = "/{0}/{1}";
         private static Assembly[] configAssemblies = new Assembly[3];
 
         private static Dictionary<string, Table> tables = new Dictionary<string, Table>();
@@ -112,6 +113,23 @@ namespace ET
                     Directory.Delete(ServerClassDir, true);
                 }
 
+                if (Directory.Exists(CSClassDir))
+                {
+                    Directory.Delete(CSClassDir, true);
+                }
+
+                string jsonProtoDirParent = jsonDir.Replace(replaceStr, string.Empty);
+                if (Directory.Exists(jsonProtoDirParent))
+                {
+                    Directory.Delete(jsonProtoDirParent, true);
+                }
+
+                string serverProtoDirParent = serverProtoDir.Replace(replaceStr, string.Empty);
+                if (Directory.Exists(serverProtoDirParent))
+                {
+                    Directory.Delete(serverProtoDirParent, true);
+                }
+
                 List<string> files = FileHelper.GetAllFiles(excelDir);
                 foreach (string path in files)
                 {