MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / run_shell_command

Function run_shell_command

utils/install.py:1125–1144  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

1123
1124
1125def run_shell_command(cmd):
1126 try:
1127 output = subprocess.check_output([cmd], shell=True)
1128 return output.decode("utf8").strip()
1129 except subprocess.CalledProcessError as e:
1130 if "Cannot detect installation path" in str(e.output):
1131 logging.warning("Uninstaller did not find previous installation")
1132 elif "ldconfig" in str(e.cmd):
1133 logging.debug("Cannot detect libcudart via ldconfig")
1134 elif "nvcc" in str(e.cmd):
1135 logging.debug("Cannot detect CUDA via nvcc")
1136 else:
1137 logging.error(
1138 "Exception on process - rc= %s output= %s command= %s",
1139 e.returncode,
1140 e.output,
1141 e.cmd,
1142 )
1143
1144 return ""
1145
1146
1147def get_latest_github_release(repo):

Callers 9

check_nvccFunction · 0.85
check_nvidia_smiFunction · 0.85
check_libcudartFunction · 0.85
ldconfigFunction · 0.85
__init__Method · 0.85
mainFunction · 0.85

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected