From a563ea879ef5fb6897e76d2df661e465dce2ab9b Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 01 六月 2026 15:02:27 +0800
Subject: [PATCH] Merge branch 'dev_新疆_大罗素马铃薯new' of http://114.132.189.42:9002/r/product-inventory-management into dev_新疆_大罗素马铃薯new
---
multiple/multiple-build.js | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/multiple/multiple-build.js b/multiple/multiple-build.js
index d87b333..8e078e1 100644
--- a/multiple/multiple-build.js
+++ b/multiple/multiple-build.js
@@ -24,19 +24,6 @@
const envFilePath = path.join(process.cwd(), '.env.production.local');
-async function copyFileWithOverwrite(src, dest) {
- await fs.mkdir(path.dirname(dest), { recursive: true });
- if (fsSync.existsSync(dest)) {
- try {
- await fs.chmod(dest, 0o666);
- } catch {
- // Ignore chmod failure and try delete directly.
- }
- await fs.rm(dest, { force: true });
- }
- await fs.copyFile(src, dest);
-}
-
try {
// 1锔忊儯 鐢熸垚 .env
console.log("=======鐢熸垚.env=======");
@@ -54,8 +41,9 @@
const backupFile = path.join(replacePath, config[key]);
const replaceFile = path.join(resourcePath, companyMap[key]);
- await copyFileWithOverwrite(originFile, backupFile);
- await copyFileWithOverwrite(replaceFile, originFile);
+ await fs.mkdir(path.dirname(backupFile), { recursive: true });
+ await fs.copyFile(originFile, backupFile);
+ await fs.copyFile(replaceFile, originFile);
}
console.log("=====寮�濮嬫墦鍖�======");
@@ -78,7 +66,7 @@
const originFile = path.join(rootPath, config[key]);
const backupFile = path.join(replacePath, config[key]);
- await copyFileWithOverwrite(backupFile, originFile);
+ await fs.copyFile(backupFile, originFile);
}
await fs.rm(replacePath, { recursive: true, force: true });
console.log(`馃棏锔� 宸插垹闄� ${replacePath}`);
--
Gitblit v1.9.3