Open Waquo opened 13 years ago
what's nodules?
https://github.com/kriszyp/nodules
Nodules has to overwrite the global require function, it is used like this:
Instead of just
node runme.js
you run
node /path/to/nodules.js runme.js
and all code run by runme.js uses the require() provided by nodules.
nodules runme.js
is a shorthand for this.
I didn't test it, but require.js replaces require() the same way, so i guess it would result in the same problem.
hm, yeah I would probably just tell them not to do that haha, but yeah we just need to make sure we run the same command that spawned the master originally
I don't think calling the command is the issue.
If calling
node /path/to/nodules.js runme.js
worked the first time, "/path/to/nodules.js runme.js" should work just fine as a command. The problem is that logfiles etc. should be placed in /path/to/runme.js, not /path/to/nodules.js.
I suppose the most straightforward solution would be to allow set()ing the server path as an option, with the current solution as a default. This way users of wrapper-scripts like nodules or require.js could at least fix this issue if it comes up.
When running a script with nodules like this,
nodules script.js
instead of this,node script js
this code in master.jsalways grabs the first parameter passed to node, even though that is nodules.
Assuming the path to nodules is /node/bin/nodules, this will lead to paths being resolved to "/node/bin/./logs/master.log" or some such.
I suppose require.js would lead to the same problem as nodules.