MCPcopy Index your code
hub / github.com/pyinvoke/invoke / run

Function run

invoke/__init__.py:36–52  ·  view source on GitHub ↗

Run ``command`` in a subprocess and return a `.Result` object. See `.Runner.run` for API details. .. note:: This function is a convenience wrapper around Invoke's `.Context` and `.Runner` APIs. Specifically, it creates an anonymous `.Context` instance and call

(command: str, **kwargs: Any)

Source from the content-addressed store, hash-verified

34
35
36def run(command: str, **kwargs: Any) -> Result:
37 """
38 Run ``command`` in a subprocess and return a `.Result` object.
39
40 See `.Runner.run` for API details.
41
42 .. note::
43 This function is a convenience wrapper around Invoke's `.Context` and
44 `.Runner` APIs.
45
46 Specifically, it creates an anonymous `.Context` instance and calls its
47 `~.Context.run` method, which in turn defaults to using a `.Local`
48 runner subclass for command execution.
49
50 .. versionadded:: 1.0
51 """
52 return Context().run(command, **kwargs)
53
54
55def sudo(command: str, **kwargs: Any) -> Result:

Calls 2

ContextClass · 0.85
runMethod · 0.45

Tested by

no test coverage detected