MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / run_interactive_shell

Function run_interactive_shell

commitizen/cmd.py:133–145  ·  view source on GitHub ↗

Run a command without redirecting stdin, stdout, or stderr Args: cmd: The command to run env: Extra environment variables to define in the subprocess. Defaults to None. Returns: subprocess returncode

(cmd: str, env: Mapping[str, str] | None = None)

Source from the content-addressed store, hash-verified

131
132
133def run_interactive_shell(cmd: str, env: Mapping[str, str] | None = None) -> int:
134 """Run a command without redirecting stdin, stdout, or stderr
135
136 Args:
137 cmd: The command to run
138 env: Extra environment variables to define in the subprocess. Defaults to None.
139
140 Returns:
141 subprocess returncode
142 """
143 if env is not None:
144 env = {**os.environ, **env}
145 return subprocess.run(cmd, shell=True, env=env).returncode

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected