Merge branch 'main' into next

This commit is contained in:
nocobase[bot] 2025-04-22 01:54:09 +00:00
commit b979e8b71a

View File

@ -48,6 +48,7 @@ module.exports = (cli) => {
.option('-i, --instances [instances]') .option('-i, --instances [instances]')
.option('--db-sync') .option('--db-sync')
.option('--quickstart') .option('--quickstart')
.option('--launch-mode [launchMode]')
.allowUnknownOption() .allowUnknownOption()
.action(async (opts) => { .action(async (opts) => {
checkDBDialect(); checkDBDialect();
@ -119,17 +120,27 @@ module.exports = (cli) => {
]); ]);
process.exit(); process.exit();
} else { } else {
run( const launchMode = opts.launchMode || process.env.APP_LAUNCH_MODE || 'pm2';
'pm2-runtime', if (launchMode === 'pm2') {
[ run(
'start', 'pm2-runtime',
...instancesArgs, [
`${APP_PACKAGE_ROOT}/lib/index.js`, 'start',
NODE_ARGS ? `--node-args="${NODE_ARGS}"` : undefined, ...instancesArgs,
'--', `${APP_PACKAGE_ROOT}/lib/index.js`,
...process.argv.slice(2), NODE_ARGS ? `--node-args="${NODE_ARGS}"` : undefined,
].filter(Boolean), '--',
); ...process.argv.slice(2),
].filter(Boolean),
);
} else {
run(
'node',
[`${APP_PACKAGE_ROOT}/lib/index.js`, ...(NODE_ARGS || '').split(' '), ...process.argv.slice(2)].filter(
Boolean,
),
);
}
} }
}); });
}; };