-
Notifications
You must be signed in to change notification settings - Fork 744
exec('nohup node some.js &') #426
Copy link
Copy link
Closed
Description
Not sure if its a bug rather question.
- node - 5.10.0
- shelljs - ^0.6.0
- os - OS X 10.11.4
Can I do something like:
// index.js
require('shelljs/global');
const path = require('path');
const target = path.join(process.cwd(), process.argv[2])
exec('nohup node ./watcher.js ' + target + '&');// watcher.js
const fs = require('fs');
function watch(dir) {
fs.watch(dir, (event, filename) => {
if (filename) {
// do something
}
});
}
watch(process.argv[2]);node src/index.js ./test/fixturesI expect the index.js to terminate and on ps -ef | grep watcher to find the process corresponding to watcher.js listed
In practice it doesn't. Is it by design?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels