Handle cmdline args in the nodejs script

This commit is contained in:
pancake 2015-03-31 01:33:40 +02:00
parent 35baae988e
commit 14893faffe
1 changed files with 5 additions and 1 deletions

View File

@ -47,5 +47,9 @@ function runWebServer(r) {
if (process.env.R2PIPE_IN) {
var r = r2p.rlangpipe(runWebServer);
} else {
var r = r2p.pipe ("/bin/ls", runWebServer);
var targetfile = "/bin/ls";
if (process.argv.length>2) {
targetfile = process.argv[2];
}
var r = r2p.pipe (targetfile, runWebServer);
}