feat: add CentOS7 single executable build

This commit is contained in:
shiyue
2026-06-24 10:36:03 +08:00
parent a794607817
commit 67914ba10f
8 changed files with 365 additions and 26 deletions

View File

@@ -1,10 +1,12 @@
'use strict';
const path = require('path');
const { fork } = require('child_process');
const { fork, spawn } = require('child_process');
function createCodexAppWorkerClient(options = {}) {
const workerPath = options.workerPath || path.join(__dirname, 'codex-app-worker.js');
const workerCommand = String(options.workerCommand || '').trim();
const workerArgs = Array.isArray(options.workerArgs) ? options.workerArgs : [];
const onNotification = typeof options.onNotification === 'function' ? options.onNotification : () => {};
const onServerRequest = typeof options.onServerRequest === 'function' ? options.onServerRequest : null;
const onExit = typeof options.onExit === 'function' ? options.onExit : () => {};
@@ -40,11 +42,14 @@ function createCodexAppWorkerClient(options = {}) {
workerExited = false;
configured = false;
appServerRunning = false;
worker = fork(workerPath, [], {
const spawnOptions = {
cwd: options.cwd || process.cwd(),
env: options.env || process.env,
stdio: ['ignore', 'ignore', 'ignore', 'ipc'],
});
};
worker = workerCommand
? spawn(workerCommand, workerArgs, spawnOptions)
: fork(workerPath, [], spawnOptions);
worker.on('message', (message = {}) => {
if (Object.prototype.hasOwnProperty.call(message, 'id')) {