mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 15:48:00 +00:00
feat(cli): add daemon option to start command
This commit is contained in:
parent
307c4ca1dc
commit
689a793593
@ -13,6 +13,7 @@ module.exports = (cli) => {
|
|||||||
cli
|
cli
|
||||||
.command('start')
|
.command('start')
|
||||||
.option('-p, --port [port]')
|
.option('-p, --port [port]')
|
||||||
|
.option('-d, --daemon')
|
||||||
.option('--db-sync')
|
.option('--db-sync')
|
||||||
.allowUnknownOption()
|
.allowUnknownOption()
|
||||||
.action(async (opts) => {
|
.action(async (opts) => {
|
||||||
@ -48,6 +49,15 @@ module.exports = (cli) => {
|
|||||||
if (opts.dbSync) {
|
if (opts.dbSync) {
|
||||||
await run('node', [`./packages/${APP_PACKAGE_ROOT}/server/lib/index.js`, 'db:sync']);
|
await run('node', [`./packages/${APP_PACKAGE_ROOT}/server/lib/index.js`, 'db:sync']);
|
||||||
}
|
}
|
||||||
run('pm2-runtime', ['start', `packages/${APP_PACKAGE_ROOT}/server/lib/index.js`, '--', ...process.argv.slice(2)]);
|
if (opts.daemon) {
|
||||||
|
run('pm2', ['start', `packages/${APP_PACKAGE_ROOT}/server/lib/index.js`, '--', ...process.argv.slice(2)]);
|
||||||
|
} else {
|
||||||
|
run('pm2-runtime', [
|
||||||
|
'start',
|
||||||
|
`packages/${APP_PACKAGE_ROOT}/server/lib/index.js`,
|
||||||
|
'--',
|
||||||
|
...process.argv.slice(2),
|
||||||
|
]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user