#!/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); } } ]);