2009-09-28 12:36:36 +02:00
|
|
|
libDir = node.path.join(node.path.dirname(__filename), "../lib");
|
|
|
|
node.libraryPaths.unshift(libDir);
|
2009-10-05 15:46:31 +02:00
|
|
|
node.mixin(require("/utils.js"));
|
2009-07-13 12:48:59 +02:00
|
|
|
function next (i) {
|
|
|
|
if (i <= 0) return;
|
|
|
|
|
2009-08-26 22:11:51 +02:00
|
|
|
var child = node.createChildProcess("echo hello");
|
2009-07-13 12:48:59 +02:00
|
|
|
|
2009-08-26 22:11:51 +02:00
|
|
|
child.addListener("output", function (chunk) {
|
2009-07-13 12:48:59 +02:00
|
|
|
if (chunk) print(chunk);
|
|
|
|
});
|
|
|
|
|
2009-08-26 22:11:51 +02:00
|
|
|
child.addListener("exit", function (code) {
|
2009-09-28 16:50:19 +02:00
|
|
|
if (code != 0) process.exit(-1);
|
2009-07-13 12:48:59 +02:00
|
|
|
next(i - 1);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
next(500);
|