From a35679754f3b2547bbbe5f2f6360cea31ff0433e Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期日, 12 四月 2026 09:04:46 +0800
Subject: [PATCH] fix: 打包配置修改
---
multiple/multiple-build.js | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/multiple/multiple-build.js b/multiple/multiple-build.js
index 8e078e1..b1c0736 100644
--- a/multiple/multiple-build.js
+++ b/multiple/multiple-build.js
@@ -16,6 +16,7 @@
const rootPath = path.resolve(__dirname, '..');
const resourcePath = path.join(rootPath, 'multiple', 'assets');
const replacePath = path.join(rootPath, 'replace');
+const replacedFiles = [];
// 鑾峰彇鍛戒护琛屽弬鏁�
const params = parseArgs(process.argv);
@@ -43,6 +44,7 @@
await fs.mkdir(path.dirname(backupFile), { recursive: true });
await fs.copyFile(originFile, backupFile);
+ replacedFiles.push({ originFile, backupFile });
await fs.copyFile(replaceFile, originFile);
}
@@ -60,13 +62,10 @@
// 鎭㈠璧勬簮鏂囦欢
if (fsSync.existsSync(replacePath)) {
- for (const [key, value] of Object.entries(companyMap)) {
- if (key === 'env') continue;
-
- const originFile = path.join(rootPath, config[key]);
- const backupFile = path.join(replacePath, config[key]);
-
- await fs.copyFile(backupFile, originFile);
+ for (const { originFile, backupFile } of replacedFiles) {
+ if (fsSync.existsSync(backupFile)) {
+ await fs.copyFile(backupFile, originFile);
+ }
}
await fs.rm(replacePath, { recursive: true, force: true });
console.log(`馃棏锔� 宸插垹闄� ${replacePath}`);
--
Gitblit v1.9.3