mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 03:21:58 +08:00
e6ef4b615f
- fixes #252
33 lines
830 B
JavaScript
Executable File
33 lines
830 B
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('users', 'work with the application auth')
|
|
.parse(process.argv);
|
|
|
|
// If there is no command listed, output help.
|
|
if (!process.argv.slice(2).length) {
|
|
program.outputHelp();
|
|
return;
|
|
}
|
|
|
|
// The ensures that the child process that is created here is always cleaned up
|
|
// properly when the parent process dies.
|
|
util.onshutdown([
|
|
(signal) => {
|
|
if ((program.runningCommand.killed === false) && (program.runningCommand.exitCode === null)) {
|
|
program.runningCommand.kill(signal);
|
|
}
|
|
}
|
|
]);
|