MCPcopy Create free account
hub / github.com/DanielKeep/rust-conv / sh_eval

Function sh_eval

update-docs.py:27–37  ·  view source on GitHub ↗
(cmd, codec='utf-8', dont_strip=False)

Source from the content-addressed store, hash-verified

25 raise
26
27def sh_eval(cmd, codec='utf-8', dont_strip=False):
28 msg_trace('sh_eval(%r)' % cmd)
29 result = None
30 try:
31 result = subprocess.check_output(cmd, shell=True).decode(codec)
32 if not dont_strip:
33 result = result.strip()
34 except:
35 msg_trace('FAILED!')
36 raise
37 return result
38
39def msg(*args):
40 if USE_ANSI: sys.stdout.write('\x1b[1;34m')

Callers 1

mainFunction · 0.85

Calls 1

msg_traceFunction · 0.85

Tested by

no test coverage detected