[Rpm-maint] [rpm-software-management/rpm] Add rpm.spawn() Lua API (PR #3241)

Miro Hrončok notifications at github.com
Tue Aug 13 12:02:08 UTC 2024


@hroncok commented on this pull request.



> +
+#### spawn({command} [, {actions}])
+
+Spawn, aka execute, an external program. (rpm >= 4.20)
+
+`{command}` is a table consisting of the command and its arguments.
+An optional second table can be used to pass various actions related
+to the command execution, currently supported are:
+
+| Action  | Argument(s) | Description
+|---------|----------------------
+| `stdin` | path        | Redirect standard input to path
+| `stdout`| path        | Redirect standard output to path
+| `stderr`| path        | Redirect standard error to path
+
+Returns the command exit status.

I see:

```lua
> rpm.execute('true')
0,0
> rpm.execute('false')
nil	"exit code"	256,0
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3241#discussion_r1715176231
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3241/review/2235361504 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240813/7b247012/attachment.html>


More information about the Rpm-maint mailing list