runtimejs / runtime

[not maintained] Lightweight JavaScript library operating system for the cloud
http://runtimejs.org
Apache License 2.0
1.93k stars 128 forks source link

runtime.shell.runCommand(): Not using args in object parameter #67

Closed facekapow closed 9 years ago

facekapow commented 9 years ago

When you pass an object as the second parameter to runCommand, the args option in it is not used. I believe the problem is in /js/service/shell/index.js, line 39 (https://github.com/runtimejs/runtime/blob/master/js/service/shell/index.js#L39), where it rests the args parameter. Maybe instead of opts.args = [];, it could be opts.args = opts.args || [];. I'm pretty sure that's the problem, because I changed it (in my clone of the repo) and it worked as it should.

piranna commented 9 years ago

Besides an argv-like array, it could be an object so command line args parsing is not needed :-)

facekapow commented 9 years ago

You have a point. I''m just reporting an issue that I saw. But object params would make it easier for applications to get their parameters.

piranna commented 9 years ago

I have just got the idea when I saw your issue, that's all :-P

iefserge commented 9 years ago

Yep, this looks like a bug.

facekapow commented 9 years ago

I didn't see it in my PR. Noticed it after it merged.