|
@@ -278,19 +278,41 @@ public class OwenServiceImpl implements OwenService {
|
|
|
for (File file : faFiles) {
|
|
|
String dirPath = file.getAbsolutePath();
|
|
|
String dirName = file.getName();
|
|
|
- if (FileUtil.isDirectory(dirPath) && dirName.startsWith("t-")){
|
|
|
- log.info("场景码目录:{}", dirPath);
|
|
|
- log.info("目录场景码: {}", dirName);
|
|
|
-
|
|
|
- // 替换css
|
|
|
- this.writeFile(baseCssPath, sDir + dirName + "/css/style.css");
|
|
|
- this.writeFile(baseIndexJsPath, sDir + dirName + "/js/index.js");
|
|
|
- String sceneCodeIndexHtmlPath = sDir + dirName + "/index.html";
|
|
|
- String title = getTitleByIndexHtml(sceneCodeIndexHtmlPath);
|
|
|
- this.writeIndexHtml(baseIndexHtmlPath, sceneCodeIndexHtmlPath, dirName, title);
|
|
|
- this.copyImg(baseImgPath, sDir + dirName + "/img");
|
|
|
- i ++;
|
|
|
- log.info("替换第: {} 个, 场景码: {}", i, dirName);
|
|
|
+
|
|
|
+ if (FileUtil.isDirectory(dirPath) ){
|
|
|
+ boolean flag = false;
|
|
|
+ if ("pro".equals(configConstant.active)){ // 正式场景码
|
|
|
+ if (dirName.length() == 10){ // 场景码长度为10
|
|
|
+ String indexHtmlPath = dirPath + "/index.html";
|
|
|
+ if (FileUtil.isFile(indexHtmlPath)){
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } else { // 测试场景码
|
|
|
+ if(dirName.startsWith("t-")){
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (flag){
|
|
|
+ log.info("场景码目录:{}", dirPath);
|
|
|
+ log.info("目录场景码: {}", dirName);
|
|
|
+
|
|
|
+ // 替换css
|
|
|
+ this.writeFile(baseCssPath, sDir + dirName + "/css/style.css");
|
|
|
+ this.writeFile(baseIndexJsPath, sDir + dirName + "/js/index.js");
|
|
|
+ String sceneCodeIndexHtmlPath = sDir + dirName + "/index.html";
|
|
|
+ String title = getTitleByIndexHtml(sceneCodeIndexHtmlPath);
|
|
|
+ this.writeIndexHtml(baseIndexHtmlPath, sceneCodeIndexHtmlPath, dirName, title);
|
|
|
+ this.copyImg(baseImgPath, sDir + dirName + "/img");
|
|
|
+ i ++;
|
|
|
+ log.info("替换第: {} 个, 场景码: {}", i, dirName);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if (!"0".equals(isBatch)){
|