Last active
December 27, 2015 11:59
-
-
Save alepez/7322632 to your computer and use it in GitHub Desktop.
Launch a detached process of node running 'app.js' in the same directory of this script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var spawn = require('child_process').spawn; | |
var path = require('path'); | |
var nodeBin = process.execPath; | |
var appjs = path.resolve(__dirname, 'app.js'); | |
var options = { detached: true, stdio: 'ignore', cwd: __dirname }; | |
var child = spawn(nodeBin, [appjs], options); | |
child.unref(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment