From 7c2cdcbc7f5585b96fba76a07b0e4417a09c4d7e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 02 六月 2026 11:06:10 +0800
Subject: [PATCH] 新疆马铃薯 1.过程检验下载添加3个模版
---
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