From 2acdee4651d3bf785a3501287b40964f83a56a0e Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期四, 05 九月 2024 15:15:06 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/WI/Web.Admin.V1.0 --- scripts/build.js | 14 -------------- scripts/helper.js | 23 ++++++++++++++++++++--- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 2f7640d..f51daee 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -27,20 +27,6 @@ copyFile(); -// 澶嶅埗amis-editor 鍒� public鏂囦欢澶逛腑 -const amisEditorPath = path.join(rootDir,'amis-editor'); -const targetPath = path.join(publicDir,'amis-editor') -const isExist = fs.pathExistsSync(amisEditorPath); -if(!isExist){ - logWarn('amis-editor 涓嶅瓨鍦紒'); -}else{ - const isExist = fs.pathExistsSync(targetPath); - if(!isExist){ - fs.mkdirSync(targetPath); - } - const res = fs.copySync(amisEditorPath,targetPath) - res ?? logSuccess('========= 宸查泦鎴� amis-editor =========') -} // 鏇存敼 import.meta.glob updateImportGlob(); diff --git a/scripts/helper.js b/scripts/helper.js index 25956fe..bb8a764 100644 --- a/scripts/helper.js +++ b/scripts/helper.js @@ -15,7 +15,7 @@ const customerProjectListDir = path.join(rootDir, 'src', 'views', 'project'); const firstCustomerName = customerList[0]?.split(':')[0]; /** 鍏叡鏂囦欢澶癸紝鎵�鏈夊鎴锋枃浠跺す鍏变韩鏂囦欢 */ -const commonDir = path.join(customerListDir,'common') +const commonDir = path.join(customerListDir, 'common'); const homeDir = os.homedir(); // const deployEnv = process.argv[3]; @@ -31,7 +31,6 @@ const logSuccess = (text) => { logColor(text, 'green'); }; - const logWarn = (text) => { logColor(text, 'yellow'); @@ -190,6 +189,23 @@ return format; }; +const copyAmisEditor = () => { + // 澶嶅埗amis-editor 鍒� public鏂囦欢澶逛腑 + const amisEditorPath = path.join(rootDir, 'amis-editor'); + const targetPath = path.join(publicDir, 'amis-editor'); + const isExist = fs.pathExistsSync(amisEditorPath); + if (!isExist) { + logWarn('amis-editor 涓嶅瓨鍦紒'); + } else { + const isExist = fs.pathExistsSync(targetPath); + if (!isExist) { + fs.mkdirSync(targetPath); + } + const res = fs.copySync(amisEditorPath, targetPath); + res ?? logSuccess('========= 宸查泦鎴� amis-editor ========='); + } +}; + /** * 澶嶅埗鏂囦欢鍒� public 鏂囦欢澶逛腑 * (鍙兘澶嶅埗涓�涓鎴锋枃浠堕厤缃�) @@ -216,7 +232,8 @@ const customerDir = path.join(customerListDir, firstCustomerName); // 澶嶅埗婧愭枃浠跺す涓殑鎵�鏈夋枃浠跺埌 public 鏂囦欢澶� fs.copySync(customerDir, publicDir, { filter }); - fs.copySync(commonDir,publicDir); + fs.copySync(commonDir, publicDir); + copyAmisEditor(); } /** -- Gitblit v1.9.3