calls external commands#64
calls external commands#64wbehrens-on-gh wants to merge 1 commit intowren-lang:mainfrom wbehrens-on-gh:externalCommands
Conversation
|
I think the C As the CLI is based on libuv, I think we should provide an API based on libuv processes. |
|
I'm not familiar with working with libuv but I'll see if I can throw something up. |
|
Even if it's only done as a temporary expedient, I think it would make sense to merge this relatively simple PR into the forthcoming v0.4.0 release as it would make a significant difference to what can be done with Wren-cli. An API based on libuv processes can be added later. |
|
If so, then at least have arguments passed separately using a list. |
|
Could you explain why there is a need to pass arguments as a list? most users will just pass a single string with the arguments in it anyway. |
|
Security. |
|
Could you explain how it would help security? |
|
If I do, Process.exec("cat \"%(fileName)\"")When |
|
Of course this quickly gets into:
But I think for starters just a run it and let you know the error code would be trivial. And if UV gets us cross-platform for free, even better. My first ideas for packages require being able to call |
|
See #94 for a quick pass at this based on UV. |
|
I believe this will be closed now that we are moving forward with #94. |
Added an
execcommand to theProcessclass that basically wraps C'ssystem()function so now Wren-cli can call external programs.Example:
Don't think this is a perfect implementation but it's minimal.