chore: upgrade onlyoffice to 9.2.1

This commit is contained in:
liaibo
2025-12-26 07:52:40 +08:00
parent 8356734742
commit 9bd5c9c403
8 changed files with 364 additions and 12 deletions
+28 -1
View File
@@ -16,6 +16,7 @@ const { spawn } = require("child_process");
const path = require("path");
const net = require("net");
const { URL } = require("url");
const fs = require("fs");
const rootDir = path.resolve(__dirname, "..");
const frontendDir = path.join(rootDir, "wolai-frontend");
@@ -47,6 +48,32 @@ const tasks = [
const children = [];
let shuttingDown = false;
function loadEnvFile(filePath) {
if (!fs.existsSync(filePath)) return {};
const content = fs.readFileSync(filePath, "utf8");
return content
.split(/\r?\n/)
.filter((line) => line.trim() && !line.trim().startsWith("#"))
.reduce((acc, line) => {
const idx = line.indexOf("=");
if (idx === -1) return acc;
const key = line.slice(0, idx).trim();
const value = line.slice(idx + 1).trim();
acc[key] = value;
return acc;
}, {});
}
const envFromRoot = loadEnvFile(path.join(rootDir, ".env.local"));
const envFromFrontend = loadEnvFile(path.join(frontendDir, ".env.local"));
const envFromBackend = loadEnvFile(path.join(backendDir, ".env.local"));
const mergedEnv = {
...process.env,
...envFromRoot,
...envFromFrontend,
...envFromBackend,
};
function logPrefix(name, message) {
console.log(`[${name}] ${message}`);
}
@@ -57,7 +84,7 @@ function startTask(task) {
cwd: task.cwd,
stdio: "inherit",
shell: true,
env: { ...process.env },
env: mergedEnv,
});
child.on("exit", (code, signal) => {