Skip to content

Instantly share code, notes, and snippets.

@aikar
Created November 23, 2010 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aikar/711387 to your computer and use it in GitHub Desktop.
Save aikar/711387 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
//CLI Script for starting apps
var args = process.argv,
exec = require('child_process').exec,
util = require('util'),
daemonize = require('fork').daemonize;
if(args[2] == 'start' && args[3])
{
require('./app/' + args[3]);
//var cmd = 'nohup node app/' + args[3] + '/index.js &'
//console.log(cmd);
//exec(cmd);
}
daemonize();
//var x = process.openStdin();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment