mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 18:30:01 +08:00
32 lines
1.1 KiB
JavaScript
Executable File
32 lines
1.1 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Module dependencies.
|
|
*/
|
|
|
|
// const util = require('./util');
|
|
const program = require('./commander');
|
|
|
|
program
|
|
.command('serve', 'serve the application')
|
|
.command('assets', 'interact with assets')
|
|
.command('setup', 'setup the application')
|
|
.command('jobs', 'work with the job queues')
|
|
.command('token', 'work with the access tokens')
|
|
.command('users', 'work with the application auth')
|
|
.command('migration', 'provides utilities for migrating the database')
|
|
.command('plugins', 'provides utilities for interacting with the plugin system')
|
|
.parse(process.argv);
|
|
|
|
/**
|
|
* When this provess exists, check to see if we have a running command, if we do
|
|
* check to see if it is still running. If it is, then kill it with a SIGINT
|
|
* signal. This is for the use case where we want to kill the process that is
|
|
* labled with the PID written out by the parent process.
|
|
*/
|
|
process.once('exit', () => {
|
|
if ((program.runningCommand.killed === false) && (program.runningCommand.exitCode === null)) {
|
|
program.runningCommand.kill('SIGINT');
|
|
}
|
|
});
|