MCPcopy Index your code
hub / github.com/microsoft/SandDance / run

Function run

python/jupyter-widget/setupbase.py:210–223  ·  view source on GitHub ↗

Echo a command before running it. Defaults to repo as cwd

(cmd, **kwargs)

Source from the content-addressed store, hash-verified

208
209
210def run(cmd, **kwargs):
211 """Echo a command before running it. Defaults to repo as cwd"""
212 log.info('> ' + list2cmdline(cmd))
213 kwargs.setdefault('cwd', HERE)
214 kwargs.setdefault('shell', os.name == 'nt')
215 if not isinstance(cmd, (list, tuple)) and os.name != 'nt':
216 cmd = shlex.split(cmd)
217 cmd_path = which(cmd[0])
218 if not cmd_path:
219 sys.exit("Aborting. Could not find cmd (%s) in path. "
220 "If command is not expected to be in user's path, "
221 "use an absolute path." % cmd[0])
222 cmd[0] = cmd_path
223 return subprocess.check_call(cmd, **kwargs)
224
225
226def is_stale(target, source):

Callers 1

runMethod · 0.70

Calls 3

list2cmdlineFunction · 0.85
whichFunction · 0.85
infoMethod · 0.45

Tested by

no test coverage detected