Pass CLI args to worker and update login script example

The quickLoginExample.bat script was updated to use the new launcher script names and argument format. In napcat.ts, the master process now forwards its command line arguments to the worker process, enabling better parameter handling.
This commit is contained in:
手瓜一十雪 2026-01-17 18:54:18 +08:00
parent d4478275ee
commit 0ba5862753
2 changed files with 4 additions and 3 deletions

View File

@ -3,5 +3,5 @@ REM 快速登录示例脚本
REM -q 参数是可选的,不传则使用二维码登录 REM -q 参数是可选的,不传则使用二维码登录
REM REM
REM 使用方法(删掉对应系统那行的 REM REM 使用方法(删掉对应系统那行的 REM
REM ./launcher.bat -q 123456 REM ./launcher-user.bat 123456
REM ./launcher-win10.bat -q 123456 REM ./launcher-win10-user.bat 123456

View File

@ -151,7 +151,8 @@ async function startWorker (): Promise<void> {
const workerScript = getWorkerScriptPath(); const workerScript = getWorkerScriptPath();
const processType = getProcessTypeName(); const processType = getProcessTypeName();
const child = processManager.createWorker(workerScript, [], { // 传递 master 进程的命令行参数给 worker 进程
const child = processManager.createWorker(workerScript, process.argv.slice(2), {
env: { env: {
...process.env, ...process.env,
NAPCAT_WORKER_PROCESS: '1', NAPCAT_WORKER_PROCESS: '1',