MCPcopy Create free account
hub / github.com/modelscope/modelscope / run_cmd

Method run_cmd

docker/build_image.py:73–84  ·  view source on GitHub ↗

Run a shell command safely via subprocess (no shell=True). Args: *args: Command and its arguments as separate strings, e.g. ``self.run_cmd('docker', 'build', '-t', tag, '.')``. Returns: The process return code (0 on success).

(self, *args: str)

Source from the content-addressed store, hash-verified

71 f.write(content)
72
73 def run_cmd(self, *args: str) -> int:
74 """Run a shell command safely via subprocess (no shell=True).
75
76 Args:
77 *args: Command and its arguments as separate strings, e.g.
78 ``self.run_cmd('docker', 'build', '-t', tag, '.')``.
79
80 Returns:
81 The process return code (0 on success).
82 """
83 result = subprocess.run(list(args), check=False)
84 return result.returncode
85
86 def build(self) -> int:
87 pass

Callers 14

__call__Method · 0.95
buildMethod · 0.80
pushMethod · 0.80
buildMethod · 0.80
pushMethod · 0.80
buildMethod · 0.80
pushMethod · 0.80
buildMethod · 0.80
pushMethod · 0.80
buildMethod · 0.80
pushMethod · 0.80
buildMethod · 0.80

Calls 1

runMethod · 0.45

Tested by

no test coverage detected