MCPcopy Create free account
hub / github.com/DSGWJQ/Feagent / run_command

Function run_command

scripts/git_push.py:8–16  ·  view source on GitHub ↗

运行命令并打印输出

(cmd)

Source from the content-addressed store, hash-verified

6
7
8def run_command(cmd):
9 """运行命令并打印输出"""
10 print(f"\n执行: {' '.join(cmd)}")
11 result = subprocess.run(cmd, capture_output=True, text=True)
12 if result.stdout:
13 print(result.stdout)
14 if result.stderr:
15 print(result.stderr, file=sys.stderr)
16 return result.returncode
17
18
19def main():

Callers 1

mainFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected