__init__

invoke.run(command: str, **kwargs: Any) Result | None

command 并在子进程中返回一个 Result 对象。

看见 Runner.run 查看接口详情。

备注

此函数是对Invoke的 ContextRunner API接口。

具体地说,它创建了一个匿名 Context 实例,并调用其 run 方法,而该方法又默认使用 Local 用于命令执行的Runner子类。

在 1.0 版本加入.

invoke.sudo(command: str, **kwargs: Any) Result | None

command 在一个 sudo 子过程并返回一个 Result 对象。

看见 Context.sudo 有关API的详细信息,如 password 科瓦格。

备注

此函数是对Invoke的 ContextRunner API接口。

具体地说,它创建了一个匿名 Context 实例,并调用其 sudo 方法,而该方法又默认使用 Local 用于命令执行的Runner子类(加上与sudo相关的部分和片段)。

在 1.4 版本加入.